webrtc应用程序显示我的Turn服务器坏了,但是可以用 [英] webrtc app show my Turn server broken, but it works

查看:394
本文介绍了webrtc应用程序显示我的Turn服务器坏了,但是可以用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在本地PC(CoTurn)上运行的电击/转弯服务器.已在" https://webrtc.github.io/样本/src/内容/peerconnection/trickle-ice/"正常工作.我有一个域名,并用公共IP配置了调制解调器.我配置了apache2以使该站点对世界可见.我有有效的letencript证书.总之一切正常.但是测试应用程序启动了连接(外部PC通过socket.io与本地通信),但是却看不到视频,控制台返回错误:ICE失败,您的TURN服务器似乎坏了,请参见about:webrtc更多细节.

I have my stun / turn server running on local pc (CoTurn). It is tested on "https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/" and works. I have a domain name and configured the modem with public ip. I configured apache2 to make the site visible to the world. I have active and valid letsencript certificates. Everything works in short. But the test application starts the connection (the external pc communicates with the local via socket.io) but then the video is not seen and the console returns the error: ICE failed, your TURN server appears to be broken, see about:webrtc for more details.

我用作测试的应用程序的链接,因为与原始文档相比,我无法进行比较.第一次使用socket.io.但是socket.io发送和接收消息,所以这些消息暂时不会出现问题.

The link of the application that I use as a test, because with my original I had no comparisons to make. First time with socket.io. But socket.io send and receive messages so these not appear a problem for now.

https://github.com/anoek/webrtc-group-chat-example

P.S.:

好的.服务器落后了.我的应用程序(但也有链接的应用程序)在本地网络上运行良好(很抱歉,我之前先检查了这一点).这些与我的turn/stun服务器相比,而不是与公共stun/turns谷歌服务器相比.这显然表明apache2服务器或/和Turn服务器的设置错误.我在哪里可以找到有关它的指南?

Ok. Server is behind the nat. My app (but linked app too) work very fine on local network (sorry I checked this point first before). These with my turn/stun server, than with public stun/turns google servers. This evidently indicates a bad setting of apache2 server or/and turn server. Where could I find a guide about it?

我的服务器状况:myServerIpLocal-xxx.xxx.xxx.xxx-> nat/router/modem WithPublicIpStatic-xx.xx.xx.xx.我可以从世界各地看到我的站点,但是服务器无法在本地网络之外工作.内部局域网工作正常.

My server situation: myServerIpLocal-xxx.xxx.xxx.xxx -> nat/router/modem WithPublicIpStatic-xx.xx.xx.xx. I can see my sites from all the world, but turn server not work outside the local network. Inside local network work ok.

这些是我的配置:

listening-port=3478
tls-listening-port=5349
alt-listening-port=3479
alt-tls-listening-port=5350
listening-ip=xxx.xxx.xxx.xxx /*mylocal ip*/
relay-ip=xxx.xxx.xxx.xxx /*mylocal ip*/
external-ip=xx.xx.xx.xx /*my public ip on nat/ruter/modem */

min-port=49152
max-port=65535
verbose
fingerprint

userdb=/var/lib/turn/turndb
realm=mysite.com
cert=/etc/ssl/certificate.pem
pkey=/etc/ssl/private.key
dh-file=/etc/turn/dhparam.pem
no-stdout-log
log-file=/myhome/.turn/turn.log

lt-cred-mech
user=myusername:mypasswd

# Turn OFF the CLI support.
# By default it is always ON.
# See also options cli-ip and cli-port.
#
no-cli

#Local system IP address to be used for CLI server endpoint. Default value
# is 127.0.0.1.
#
cli-ip=127.0.1.1

# CLI server port. Default is 5766.
#
cli-port=5766

# CLI access password. Default is empty (no password).
#
cli-password=logen

no-sslv3
no-tlsv1

推荐答案

我在turn.conf上的旧代码:

my old code on turn.conf:

lt-cred-mech user=myusername:mypasswd

lt-cred-mech user=myusername:mypasswd

但是只能在本地上班....可能是因为我使用了: sudo turnserver -L myPublicIp -o -a myrealm 在每个转弯启动命令中....

but turn work only locally .... probabily because I use: sudo turnserver -L myPublicIp -o -a myrealm at every coturn start command ....

实际上,我尝试不使用命令"turnserver",而是尝试使用onlu sudo coturn start .....

actually I try not use the command "turnserver" and I try to use onlu sudo coturn start .....

基本上在我的turn.conf文件中更改了这些内容:

basically in my turn.conf file I change these:

lt-cred-mech user=mypasswd:myusername /***** mind the gap ;) *****/

lt-cred-mech user=mypasswd:myusername /***** mind the gap ;) *****/

这是因为我的index.js文件调试从未将我的外部连接视为经过身份验证的用户.....在这些时候,我的应用程序与局域网内外的每台PC和移动设备都进行了webrtc多重连接. ..(我尝试将我的appa从西班牙巴塞罗那的电话连接到伦敦的另一电话,效果很好.)

these because my index.js file debug never see my external connection as authrized user ..... magically at these time my app perform webrtc multiple connection with every pc and mobile .... inside and outside my lan .... (I try connect my appa from phone in barcelona spain to other one in london with good result).

coturn wiki是否可能需要更新?

May be coturn wiki need to update?

最后,我要感谢拒绝我的问题的serverfault和超级用户.由于必须做出安排,因此我能够获得有关该主题的新信息和有趣的信息.

Finally I would like to thank the serverfault and super-user guys who rejected my question. Since I had to make arrangements, I was able to acquire new and interesting information on this subject.

致谢

这篇关于webrtc应用程序显示我的Turn服务器坏了,但是可以用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆