这个问题以前有人问过,但我还没有找到答案。我基本上遇到了与此处和此处所述相同的问题。
我正在尝试使用 PeerJS 设置 webRTC 连接。它在 LAN 中完美运行,但我无法让它在 Internet 上工作。我使用 coturn 作为 TURN 服务器,但到目前为止这还没有解决问题。 Chromium 控制台打印出以下内容:
PeerJS: Added ICE candidate for: client1
peer.js:1476 PeerJS: Set remoteDescription: ANSWER for: client1
peer.js:1476 PeerJS: Set remoteDescription: OFFER for: client1
peer.js:1476 PeerJS: Set remoteDescription: ANSWER for: client1
peer.js:1476 PeerJS: Received remote stream
peer.js:1476 PeerJS: Receiving stream MediaStream
peer.js:1476 PeerJS: Created answer.
peer.js:1476 PeerJS: Set localDescription: answer for: client1
3peer.js:1476 PeerJS: Received ICE candidates for: client1
3peer.js:1476 PeerJS: Added ICE candidate …Run Code Online (Sandbox Code Playgroud)