我有自己的ubuntu 19服务器。
注意:我需要一个眩晕/转服务器的视频聊天网络应用程序。如果两个设备都在同一个网络中,它已经可以工作了。
我已经成功地安装和配置了转换。我可以通过在终端中运行:turnserver
或nohup turnserver &
成功地启动旋转服务器。
注意:我有到我的服务器的SSH
连接。
我还确保了必要的端口是开放的,并使用netstat -tulpn
检查它们。
在测试sudo service coturn restart
时,我也重新启动了几次。
我在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
这是我在js中的iceServers配置,我认为它应该可以工作(我已经做了很多其他的组合)。
var pcConfig = {
'iceServers': [
{
'urls': 'stun:<MY-IP4>:80'
},
{
'urls': 'turn:<MY-IP4>:80',
'credential': '<PASSWORD>',
'username': 'root'
}
]
};
我做了大量不同的眩晕/转服务器组合,例如:
我也在我的网络项目上做过测试,这里也是:https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/。
基本上,上面的测试URL总是给我:
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.
不管我是使用google的眩晕服务器还是我自己的服务器,错误都是一样的。
如果我使用相同的网络,我的网络项目和视频聊天效果很好,但我相信眩晕和转向服务器不在同一个网络中使用。
另外,在更新JS文件时,我总是删除缓存,因此使用了新的JS文件。因此,这也不是一个问题。
编辑
此组合不会产生错误,只会:
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.
在https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/上测试
{
'urls': 'stun:<MY-IP6>:80'
},
{
'urls': 'turn:<MY-IP4>:80',
'credential': '<PASSWORD>',
'username': 'root'
}
我只使用IP6作为眩晕和IP4的轮流。视频聊天在不同的网络仍然不工作,找不到其他错误。
编辑:
今天注意到https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/不起作用。我在firefox上没有错误。但是你可以在那里输入一些不安全信息,它也不会显示错误.
编辑:
我还增加了现在有效的证书:
cert=/usr/local/etc/turn.pem
pkey=/usr/local/etc/turn.key.pem
似乎很管用。我重新开始合作,状态告诉我一切都没有问题。
视频聊天仍然不能在不同的网络中工作。
发布于 2020-04-03 09:19:02
https://stackoverflow.com/questions/60967926
复制相似问题