0

I am using the simple-peer js library to create peer to peer connections in the browser. I have setup proper signaling through socket.io and most of the time everything works fine; hand-shake is successful and p2p connection is established.

But sometimes despite proper hand-shake, p2p connection does not initiate, no error is thrown. This happens consistently on a VPN but sometimes it can happen without VPN. I am using the default google STUN server for now and there is no TURN server provided.

Any enlightenment as to what could be the cause will be appreciated.

  • 1
    very difficult to exactly point out the error in this case, I would say keep a look at chrome://webrtc-internals/ it might help you debug. – Karthik Jan 31 '20 at 07:46

1 Answers1

0

Problem is that sometimes one of the peers "sits" behind the doubled NAT or symmetric NAT, VPN is a good example. You use only STUN server, STUN could not solve internal<->external IP of the client behind the doubled NAT. You need to set up TURN server for that. You can test with free TURN, however, this is only to test the problem, not as a permanent solution. For permanent solution better to use your own TURN server.

Igor Khvostenkov
  • 714
  • 5
  • 15