peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

Firefox - ICE failed, add a TURN server

Open mastastealth opened this issue 5 years ago • 9 comments

image

Works perfectly fine in Chrome (usually), but in FF when I host, and then connect from another (FF) tab, I see some activity, but then it fails. Every once in a while, at seemingly random times in the day, without any changes in my code, it does seem to work, but its almost always this. Any ideas?

mastastealth avatar May 01 '20 21:05 mastastealth

I have the same issue. I noticed that the peer.on open event is called, but checking the peer.open is false. If I retry until open - true it still errors, BUT if I pause for a couple of seconds it works without error. I'll keep investigating and if we find a fix will post here....but if anyone else with more experience finds the problem that would be appreciated.

arcadiaAlex avatar May 10 '20 21:05 arcadiaAlex

Just started getting this error sometime in the past hour. It worked perfectly just before then, but now does not work. Very strange! I'm using firefox 76.0.1 (64-bit). The message I'm getting is "ICE failed, your TURN server appears to be broken, see about:webrtc for more details".

wyattscarpenter avatar May 18 '20 07:05 wyattscarpenter

Works now. I wonder what that was about.

wyattscarpenter avatar May 18 '20 21:05 wyattscarpenter

Seems like our public TURN server has some problems. Try to use your own instance.

afrokick avatar May 21 '20 12:05 afrokick

Same problem here. I used a self hosted peerjs-server but still get WebRTC: ICE failed, your TURN server appears to be broken, see about:webrtc for more details

Feuerhamster avatar Sep 08 '20 08:09 Feuerhamster

This also occurs for me, only on Firefox, running a local peerjs server (connecting over localhost)

will-jac avatar Nov 22 '20 22:11 will-jac

Same here (on Firefox, Chrome works fine), running local peerjs 1.3.1 server on node.js.

ghost avatar Dec 15 '20 12:12 ghost

Any updates on this? So far this has only been happening on Firefox, Chrome works fine as well for me. Firefox 88.0.1, Peerjs 1.3.1, Node 15.4.0

samshipengs avatar May 20 '21 01:05 samshipengs

Happening with me for all the browsers that are behind vpn

xerosanyam avatar Nov 17 '21 09:11 xerosanyam

Happening to me on Firefox as well.

tristan-f-r avatar Oct 31 '22 00:10 tristan-f-r

You can check the media.peerconnection.turn.disable pref (false) on the about:config page. It should be false. But try different options. As well as try media.peerconnection.ice.link_local turn on true when developing.

vsypko avatar Oct 31 '22 05:10 vsypko

Same problem, I search online it maybe due to firefox not accepting ice candidate in tcp there is a similar issue on WebRTC

orkeilius avatar Feb 06 '23 18:02 orkeilius

Can someone provide me with some code to reproduce this issue? It's not happening on my machine with Firefox on macOS. Maybe it is something OS-specific, and only happens on Windows? Do you set any special options when connecting?

jonasgloning avatar Feb 07 '23 14:02 jonasgloning

Hi This is code: https://github.com/vsypko/hockeyteam-client/blob/master/src/components/services/audioChatService.js This is demo: https://hockeyteam.site Its good work on the local net. But behind it sometimes such errors is occurring.

On Tue, Feb 7, 2023 at 4:09 PM Jonas Gloning @.***> wrote:

Can someone provide me with some code to reproduce this issue? It's not happening on my machine with Firefox on macOS. Maybe it is something OS-specific, and only happens on Windows? Do you set any special options when connecting?

— Reply to this email directly, view it on GitHub https://github.com/peers/peerjs/issues/661#issuecomment-1420836204, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRCLVJEZTMHL2QAC4CXLB3WWJJRRANCNFSM4MXLVXQQ . You are receiving this because you commented.Message ID: @.***>

vsypko avatar Mar 15 '23 11:03 vsypko

@vsypko You are not using PeerJS, right? I can’t see how this is relevant. But your config is missing a TURN server. Just add one to the config array and you should be be good.

jonasgloning avatar Mar 15 '23 23:03 jonasgloning

I guess this was just a temporary problem with the TURN server at the time. I’m closing this. If someone sees this error again, even though they are using an up-to-date PeerJS version and at least one of our TURN servers is up, please comment here, or open up a new issue.

jonasgloning avatar Mar 15 '23 23:03 jonasgloning

Hi, I'm getting this error on the latest PeerJS version in firefox. Your servers are up. I don't know if it's related but I also get the wrarning: WebRTC: Using more than two STUN/TURN servers slows down discovery

Edit: I had to manually specify a TURN server as you mention above.

crystalthoughts avatar Feb 11 '24 14:02 crystalthoughts

I can reproduce the WebRTC: ICE failed, your TURN server appears to be broken, see about:webrtc for more details. But only with Firefox and Vite-Vue. The moment I use a different web browser, or use a peerjs example that doesn't use vite (with identical code), it starts to work.

stefnotch avatar Feb 23 '24 17:02 stefnotch

I found a fix:tm: for my case. Apparently the connection breaks if one lets vite use localhost for its dev server. It starts working as soon as one switches to using 127.0.0.1

// vite.config.ts
export default defineConfig({
  // more stuff
  server: {
    host: "127.0.0.1",
  },
});

stefnotch avatar Feb 23 '24 18:02 stefnotch