peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

Works on wifi but fails over cellular

Open wcroachie opened this issue 1 year ago • 2 comments

Please, check for existing issues to avoid duplicates.

  • [X] No similar issues found.

What happened?

Works fine when "host" peer and "client" peers exchange data via data connection over wifi, but fails when 1 is on wifi and 1 is on cellular. Tried using 0.peerjs.com and 1.peerjs.com, tried enabling/disabling "secure" config flag, no dice. I did see some older, similar issues from a few years ago but they appeared to be closed and I'm not sure how to/if it is possible to reopen them

How can we reproduce the issue?

  • open this test page on laptop and phone : https://wcroachie.github.io/peertest
  • on the "host" peer device enter desired host session ID and click "start new host session" button
  • on the "client" peer device enter host session ID and click "connect to an existing host session" button
  • check console(s) on both devices Screenshot from 2024-06-18 14-41-26

What do you expected to happen?

For it to connect like it does over wifi

Environment setup

device A:

  • OS: Linux (debian bookworm)
  • Platform: laptop
  • Browser: firefox and chromium device B:
  • OS: iOS
  • Platform: iphone
  • Browser: mobile safari

Is this a regression?

No response

Anything else?

No response

wcroachie avatar Jun 18 '24 18:06 wcroachie

@wcroachie Hey bro, today I also encountered issues with cellular network and WiFi, but I managed to solve them. I came across a four-year-old issue where he used stun and turn servers provided by https://www.twilio.com/docs/stun-turn. I solved it the same way, so hopefully it helps you too. I think it might be an issue with the default stun and turn servers provided by the PeerJS server.

loethen avatar Jun 29 '24 10:06 loethen

@loethen He would you mind if you share the configuration code fir the new Peer() Having with the default peerjs servers

oxedom avatar Dec 02 '24 13:12 oxedom