Rom*_*man 5 ubuntu webrtc server coturn
我有自己的 ubuntu 19 服务器。
注意:我需要一个用于视频聊天 Web 应用程序的眩晕/转弯服务器。如果两个设备都在同一个网络中,它已经可以工作了。
我已经成功安装并配置了 coturn。我可以通过运行成功启动turnserver:
turnserver或nohup turnserver &在终端中。
注意:我SSH连接到我的服务器。
我还确保必要的端口已打开并使用netstat -tulpn.
我在测试时也重新启动了 coturn 几次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
Run Code Online (Sandbox Code Playgroud)
这是我在 js 中的 iceServers 配置,我相信它应该可以工作(我已经完成了很多其他组合)。
var pcConfig = {
'iceServers': [
{
'urls': 'stun:<MY-IP4>:80'
},
{
'urls': 'turn:<MY-IP4>:80',
'credential': '<PASSWORD>',
'username': 'root'
}
]
};
Run Code Online (Sandbox Code Playgroud)
我已经完成了大量不同的眩晕/转弯服务器组合,例如:
我使用了谷歌的 stun 服务器:stun.l.google.com:19302、stun2.l.google.com:19302 等。
我尝试了端口 3478 和 5349(当然在重新启动 coturn 之后)
我尝试将凭据用于 stun 服务器,但我确定它不需要它们
我尝试使用 IP6 地址
我也一直在我的网络项目和这里进行现场测试: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.
Run Code Online (Sandbox Code Playgroud)
无论我使用谷歌的 stun 服务器还是我自己的,错误都是一样的。
如果我使用相同的网络,我的 web 项目和视频聊天效果很好,但我相信 stun 和 turn 服务器不在同一网络中使用。
此外,当我更新我的 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.
Run Code Online (Sandbox Code Playgroud)
在https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ 上测试
{
'urls': 'stun:<MY-IP6>:80'
},
{
'urls': 'turn:<MY-IP4>:80',
'credential': '<PASSWORD>',
'username': 'root'
}
Run Code Online (Sandbox Code Playgroud)
我只是使用 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
Run Code Online (Sandbox Code Playgroud)
似乎工作。我重新启动了 coturn,状态告诉我一切正常运行。
视频聊天在不同的网络中仍然不起作用。
| 归档时间: |
|
| 查看次数: |
11689 次 |
| 最近记录: |