simple-peer icon indicating copy to clipboard operation
simple-peer copied to clipboard

Firefox cannot connect after refreshing the page from localhost

Open mrozbarry opened this issue 4 years ago • 4 comments

System

  • Arch linux 64bit
  • Firefox 77.0.1 64 bit
  • Google chrome 83.0.4103.97 (Official Build) (64-bit)

To reproduce

I'm using this repo to test things out, and I'm 99% sure the issue is not simple-peer, but I just want to step through everything that could be the problem.

Issue

When I run my app (yarn start) locally, and open a fresh firefox instance, my webrtc peer offer and other signals work exactly as expected. If I refresh the page, I get the initial offer signal, but then an error (with trickle on and off):

WebRTC: ICE failed, add a TURN server and see about:webrtc for more details
Peer error Error: "Ice connection failed."
    makeError index.js:18
    _onIceStateChange index.js:681
    oniceconnectionstatechange index.js:116

To be clear, this seems to mostly be an issue with localhost. I deployed my app on netlify and Firefox seems to behave well, or at least I haven't observed the same issues I see on localhost. On chrome, things appear to work find in any case.

I have similar issues with PeerJS as well, but PeerJS appears to have identical issues on both localhost and a deployed domain.

Otherwise, I'm not really sure how to go about debugging this. I have a pretty decent understanding of TCP/UDP sockets on a system level, but I'm not 100% clear on all the effort of doing web peer to peer.

mrozbarry avatar Jun 15 '20 19:06 mrozbarry

I also had this issue a long time ago. I had this issue with native web-rtc and not with simple-peer. My offer got send but it fails to produce an answer. But after some days, the error stopped appearing. I had this error in chrome.

Similar issue

For me simple-peer is working perfectly in localhost and my server. But When I tried to share signalling data in my LAN network it seems not working.

I tried to share signalling data with localhost and my network. The data is been transferred but it is not connecting. I don't know is that an issue. I'm using socket.io to send signalling data. socket.io is working but simple-peer is not connecting.

I test it with my PC and mobile

vj-abishek avatar Jun 20 '20 05:06 vj-abishek

This is indeed a Firefox bug I've encountered before and is unrelated to simple-peer.

We need a native reproduction case to open this in bugzilla.

t-mullen avatar Aug 08 '20 03:08 t-mullen

I've encountered similar problem in Firefox to Firefox relation only.

After refreshing the page it generates a huge amount (50+) of iceCandidates somehow, and cannot connect again. I recreate the peers on both sides when a refresh occurs, but I cannot make it work.

bmz1 avatar Mar 01 '21 11:03 bmz1

See https://github.com/feross/simple-peer/issues/819#issuecomment-930498088

hthetiot avatar Sep 29 '21 19:09 hthetiot