divanov11 / PeerChat

A peer to peer WebRTC application with controls
156 stars 111 forks source link

WebRTC: ICE failed, add a TURN server and see about:webrtc for more details #1

Open goepfert opened 2 years ago

goepfert commented 2 years ago

Hi Dennis,

I'm pretty new to WebRTC but your PeerChat Demo (+Youtube) helped me a lot to get in touch!

The Demo works fine in local networks but it seems to fails when I try to run/test it with peers on different networks (peer1 / NAT - router <-> public network <-> router - NAT / peer2). The console gives following error:

WebRTC: ICE failed, add a TURN server and see about:webrtc for more details

Yes, I'm able to google for this type of error and it seems that it's more complicated than just using publicly available STUN servers. As the error suggests one needs also setup a TURN server.

My question is: Is this really true or did I miss something?

Thanks in advance, Thomas G.

akash19coder commented 7 months ago

TURN servers act as a relay point between two peers. It acts as a fallback mechanism in case of connectivity failure between peers because of restrictive NAT/firewall configuration. May be you have restrictive NAT/firewall config which is why you are prompted to use TURN server to ensure reliable connectivity incase of STUN failure?