simple-peer: simple-peer won't connect when clients are not in the same network

simple-peer won’t connect when clients are not in the same network

It works perfectly if both clients are in the same network (connected to the same modem/WiFi) but even after setting iceServers, the connection is not working

one of many iceServers configs that I have tested:

config: { iceServers: [ { urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun1.l.google.com:19302' }, { urls: 'stun:stun2.l.google.com:19302' }, { urls: 'stun:stun3.l.google.com:19302' }, { urls: 'stun:stun4.l.google.com:19302' }, { url: 'turn:turn.bistri.com:80', credential: 'homeo', username: 'homeo', }, { url: 'turn:turn.anyfirewall.com:443?transport=tcp', credential: 'webrtc', username: 'webrtc', } ] },

am I doing anything wrong? is there any other configurations that someone is using without problems, so can help me?

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 15

Most upvoted comments

Your ice-server credentials seem to be the issue. I am using the turn server from open-relay. It works on different networks as well. This is not the issue with the simple-peer library.

Can you share the code with me? I can check with my credentials and test the issue?

@omidshakeri gotcha! I believe neither this nor peerJS are actively maintained anymore. Hence why I started Artico in the first place, to try to expand on these projects. If you give Artico a try let me know. I’d love to get some feedback on how to improve.

You can give https://github.com/matallui/artico a try! The @rtco/peer package is pretty similar to simple-peer