Ubuntu Coturn stun服务器返回一个错误,代码为701

Ubuntu Coturn stun服务器返回一个错误,代码为701,ubuntu,server,webrtc,coturn,Ubuntu,Server,Webrtc,Coturn,我有自己的ubuntu 19服务器 注意:我需要一个用于视频聊天web应用程序的stun/turn服务器。如果两个设备都在同一网络中,它就已经可以工作了 我已成功安装并配置了coturn。我可以通过运行以下命令成功启动turnserver: turnserver或nohup turnserver&在终端中 注意:我有一个到服务器的SSH连接 我还确保必要的端口已打开,并使用netstat-tulpn检查它们 在测试sudo服务coturn restart时,我也多次重新启动coturn 我在tu

我有自己的ubuntu 19服务器

注意:我需要一个用于视频聊天web应用程序的stun/turn服务器。如果两个设备都在同一网络中,它就已经可以工作了

我已成功安装并配置了coturn。我可以通过运行以下命令成功启动turnserver:
turnserver
nohup turnserver&
在终端中

注意:我有一个到服务器的
SSH
连接

我还确保必要的端口已打开,并使用
netstat-tulpn
检查它们

在测试
sudo服务coturn restart
时,我也多次重新启动coturn

我在
turnserver.conf
中使用这些配置:

# Also tried 80
listening-port=3478
# Also tried 443
tls-listening-port=5349
listening-ip=<MY-IP4>
listening-ip=<MY-IP6>
relay-ip=<MY-IP4>
external-ip=<MY-IP4>
oauth
user=root:<password>
userdb=/var/lib/turn/turndb
no-stdout-log
测试

似乎有效。我重新启动了coturn,状态告诉我一切都在正常运行


视频聊天在不同的网络中仍然不起作用。

好的。我从错误的角度看待整件事。TURN/STUN服务器设置正确

问题在于客户机/服务器代码。信号不起作用


我阅读了这篇文章,但在设置信令服务时遇到了问题。我认为这必须在一个新问题中提出

其他人可能会感兴趣:Firefox(V85.0)尚未实现onicecandidateerror,但如果无法访问TURN服务器,则使用状态为“failed”的oniceconnectionstatechange报告连接问题,例如服务器或端口被阻止,不允许TURN请求。。。
var pcConfig = {
  'iceServers': [
    {
      'urls': 'stun:<MY-IP4>:80'
    },
    {
      'urls': 'turn:<MY-IP4>:80',
      'credential': '<PASSWORD>',
      'username': 'root'
    }
  ]
};
Note: errors from onicecandidateerror above are not neccessarily fatal. For example an IPv6 DNS lookup may fail but relay candidates can still be gathered via IPv4.
The server stun:<MY-IP4>:80 returned an error with code=701:
STUN server address is incompatible.
The server stun:<MY-IP4>:80 returned an error with code=701:
STUN server address is incompatible.
Note: errors from onicecandidateerror above are not 
neccessarily fatal. For example an IPv6 DNS 
lookup may fail but relay candidates can still be gathered via IPv4.
{
  'urls': 'stun:<MY-IP6>:80'
},
{
  'urls': 'turn:<MY-IP4>:80',
  'credential': '<PASSWORD>',
  'username': 'root'
}
cert=/usr/local/etc/turn.pem                                                                                    
pkey=/usr/local/etc/turn.key.pem