0

我正在写一个聊天轮盘赌。这是链接: http: //176.58.60.219 :8181/rouletteChat/welcome.htm

我正在使用基于 WEB RTC 的 peer js。现在使用您的 wifi 连接 - 一切正常。我想在莫斯科地铁连接(有无线网络)。现在没有连接。我在这个页面上找到:http: //habrahabr.ru/company/toptechphoto/blog/203306/

    [{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
{url:'stun:stun3.l.google.com:19302'},
{url:'stun:stun4.l.google.com:19302'},
{url:'stun:stunserver.org'},
{url:'stun:stun.softjoys.com'},
{url:'stun:stun.voiparound.com'},
{url:'stun:stun.voipbuster.com'},
{url:'stun:stun.voipstunt.com'},
{url:'stun:stun.voxgratia.org'},
{url:'stun:stun.xten.com'},
{
    url: 'turn:numb.viagenie.ca',
    credential: 'muazkh',
    username: 'webrtc@live.com
'
},
{
    url: 'turn:192.158.29.39:3478?transport=udp',
    credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
    username: '28224511:1379330808'
},
{
    url: 'turn:192.158.29.39:3478?transport=tcp',
    credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
    username: '28224511:1379330808'
}]

但这并没有帮助。看起来可能需要多加一些线。谁能告诉我可能是什么问题?

4

1 回答 1

0

这些 STUN 和 TURN 服务器是公开的。所以没有人确保它有效。现在我们使用以下iceServers:

{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
{url:'stun:stun3.l.google.com:19302'},
{url:'stun:stun4.l.google.com:19302'},
{url:'stun:stunserver.org'},
{url:'stun:stun.softjoys.com'},
{url:'stun:stun.voiparound.com'},
{url:'stun:stun.voipbuster.com'},
{url:'stun:stun.voipstunt.com'},
{url:'stun:stun.voxgratia.org'},
{url:'stun:stun.xten.com'},
{
    'url': 'turn:numb.viagenie.ca',
    'credential': 'muazkh',
    'username': 'webrtc@live.com'
},
{
    'url': 'turn:192.158.29.39:3478?transport=udp',
    'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
    'username': '28224511:1379330808'
},
{
    'url': 'turn:192.158.29.39:3478?transport=tcp',
    'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
    'username': '28224511:1379330808'
}

它工作得很好。请按照以下链接了解 STUN/TURN 的工作原理 http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/?redirect_from_locale=ru http://www.slideshare.net/Audiocod/nat-traversal-在 webrtc 上下文中

如果您想确保解决 NAT 问题,您可以运行自己的 STUN 和 TURN 服务器。

于 2015-06-26T08:14:37.863 回答