即使在 TURN 上,Webrtc 也无法连接到不同的网络

asi*_*dev 6 javascript stun webrtc turn rtcmulticonnection

我在我的一个项目中使用RTCmulticonnection一切正常,除非它不能在不同的网络上工作。我已经经历了Github 问题,该问题表明它需要转向服务器才能在不同的网络上运行它。但我已经根据文档配置了转向服务器。

这是我的代码

<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script>
<script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script>

<script>
var connection = new RTCMultiConnection();

// this line is VERY_important
connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';

// if you want audio+video conferencing
connection.session = {
    audio: true,
    video: true
};

// first step, ignore default STUN+TURN servers
connection.iceServers = [];

// second step, set STUN url
connection.iceServers.push({
    urls: 'stun:mydimain.com:3478'
});

// last step, set TURN url (recommended)
connection.iceServers.push({
    urls: 'turn:mydimain.com:3478',
    credential: 'mypassword',
    username: 'myusername'
});

connection.openOrJoin('this-is-your-room-id');
</script>
Run Code Online (Sandbox Code Playgroud)

在 chrome 中检查控制台时,它不会显示任何错误,但在 Firefox 中,我收到以下错误...

ICE 失败,您的 TURN 服务器似乎已损坏,请参阅 about:webrtc 了解更多详细信息。

我已经在Trickle ICE 中测试了我的轮流服务器。我得到了响应和中继,这意味着转向和眩晕工作正常。我还检查了这个片段中的连接性,它显示

是的,TURN 服务器可以工作...

当客户端启动会话时,我可以连接到他,并在几 (2-3) 分钟后断开连接。但是当我启动会话时,它不会与客户端连接。

出于测试目的,您可以使用我从Github 获得的

// second step, set STUN url
    connection.iceServers.push({
        urls: 'stun:numb.viagenie.ca'
    });
    
    // last step, set TURN url (recommended)
    connection.iceServers.push({
        urls: 'turn:numb.viagenie.ca',
        credential: 'muazkh',
        username: 'webrtc@live.com'
    });
Run Code Online (Sandbox Code Playgroud)

在 WEBRTC-internals icecandidateerror 中得到以下错误

url: turns:mydimain.com:5349?transport=tcp
address: xxx.xxx.xx.x
port: 63612
host_candidate: address: xxx.xxx.xx.x:63612
error_text: Address not associated with the desired network interface.
error_code: 600
Run Code Online (Sandbox Code Playgroud)

现在我做错了什么?任何帮助将不胜感激。谢谢