1.安装coturn
sudo apt-get -y update
sudo apt-get install coturn
systemctl stop coturn
2.启用coturn,取消注释:TURNSERVER_ENABLED=1
目录:/etc/default/coturn
3.备份和创建配置文件
目录:/etc/turnserver.conf
添加以下配置:
listening-port=3478
tls-listening-port=5349
fingerprint
lt-cred-mech
server-name=domain
realm=domain
total-quota=100
stale-nonce=600
min-port=49152
max-port=65535
verbose
log-file=/var/log/turn.log
syslog
lt-cred-mech
user=test:test
cli-password=test
proc-user=turnserver
proc-group=turnserver
4.开启coturn服务器
systemctl start coturn
5.检查服务状态
systemctl status coturn
6.最后通过Trickle ICE测试是否部署成功
备注:服务器需开放3478的TCP/UDP的端口,40000-60000的UDP的端口