webRTC服务器部署

1006

webrtc需要两个配合服务器程序:信令服务器和穿透服务器

穿透服务器

参考:https://www.cnblogs.com/idignew/p/7440048.html

穿透服务器使用coturn
https://github.com/coturn/coturn

git clone https://github.com/coturn/coturn
cd coturn
./configure
make
sudo make install

配置turnserver.conf

cp /usr/local/etc/turnserver.conf.default   /etc/turnserver.conf
vi /etc/turnserver.conf
 
#监听端口可以不设置会默认的使用3478
listening-port=3478
#listening-ip,注意必须是你的内网IP地址如(如果你是阿里云的,就是私网地址):
listening-ip=172.xx.xx.xx
#relay-ip可以不设置,默认会使用你的外网ip地址作为转发包的中继地址,建议不设置,使用默认就可以:
#external-ip,注意必须使用你的外网IP地址如:
external-ip=xxx.xxx.xxx.xxx
#设置用户名及密码,这个是作为TURN服务器使用必须设置的,可以设置多个,我这里配置2个
user=user1:password1
user=user1:password2

启动:

turnserver -v -r  外网地址:3478 -a -o -c /etc/turnserver.conf

停止:

ps -ef|grep turnserver
kill -9 xxxx

信令服务器

https://github.com/priologic/easyrtc

 

留下一个答复

Please enter your comment!
Please enter your name here