WebRTC Ice 服务器问题 [英] WebRTC Ice Servers Issue
问题描述
未捕获的 DOMException:无法构建 'RTCPeerConnection':当 URL 方案为turn"或turns"时,用户名和凭据都需要.
Uncaught DOMException: Failed to construct 'RTCPeerConnection': Both username and credential are required when the URL scheme is "turn" or "turns".
我收到这个错误,她是我使用的冰服务器:
i have getting this error her is my using ice servers:
var servers =
{'iceServers': [
{url:'turn:numb.viagenie.ca'},
{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'
}
]
};
我的屁股在哪里?我该怎么办?
where is my falt?What can i do?
推荐答案
错误消息的内容.您列表中的第一台服务器未指定用户名或凭据:
What the error message says. The first server in your list specifies no username or credentials:
{url:'turn:numb.viagenie.ca'},
您还进一步向下重复使用相同的服务器,这次是使用凭据.
You also repeat the same server further down, this time with credentials.
这些看起来也像非工作轮转服务器从互联网上删除.免费轮换服务器是谎言.
These also look like non-working turn servers cut'n'pasted off the internet. Free turn servers is a lie.
还有太多服务器.一两次眩晕和/或转身就可以了.太多会减慢 ICE 的速度.
Also waaaaay too many servers. One or two stun and/or turn will do. Too many slows down ICE.
这篇关于WebRTC Ice 服务器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!