How do you get around NATs using WebRTC without a TURN server?

后端 未结 2 1720
南方客
南方客 2021-01-07 13:39

I\'m trying to make a peer to peer Javascript game that can be played on mobile browsers.

  • I have been able to successfully set up a p2p connection between two
2条回答
  •  花落未央
    2021-01-07 14:24

    A TURN server is a solution to the problem. If there were workarounds that didn't require it, nobody would be using it. A common misconception here is that if you add a TURN server to the system, it will relay all traffic. That isn't true, it is only used as a fallback for the connections that can not be established otherwise. In comparison to the alternative of routing all your game messages through a websocket server this will still save you 80%+ of the traffic.

    The next step is to install a TURN server. coturn is widely used and reasonably well documented. It is stable enough that, once setup, the amount of maintenance required is very low.

提交回复
热议问题