Linux系统:Ubuntu 18.04
1.安装coturn
sudo apt-get -y update
sudo apt-get install coturn
systemctl stop coturn
2.启用coturn
nano /etc/default/coturn
取消注释:
TURNSERVER_ENABLED=1
3.备份和创建配置文件
mv /etc/turnserver.conf /etc/turnserver.conf.original
nano /etc/turnserver.conf
添加以下配置:
listening-port=3478
tls-listening-port=5349
fingerprint
lt-cred-mech
server-name=domain
realm=domain
user=user:passwd
total-quota=100
stale-nonce=600
cert=/etc/ssl/cert.pem
pkey=/etc/ssl/privkey.pem
cipher-list="ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384"
proc-user=turnserver
proc-group=turnserver
4.turnadmin创建一个用户
sudo turnadmin -a -u username -r domain -p passwd
5.开启coturn服务器
systemctl start coturn
6.检查服务状态
systemctl status coturn
最后一步:
访问【https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/】测试