2
votes

These days, I'm really into webRTC technology, and I've been studying webRTC. But, I'm faced with a problem.

I understand that webRTC is using the ICE framework, which has TURN, STUN sever for relay and signaling. But as this article said, webRTC doesn't need a TURN server.

So I'm really curious whether it is possible to connect successfully every time without a TURN sever?

If it is, please tell me the way, and if it isn't, how often are peers using the TURN server in average?

Thank you.

(PS, Azar (one of the biggest apps using webRTC) also said they don't use the TURN sever on their website)

1

1 Answers

3
votes

Yes it's possible to connect without a TURN server. Every time? Yes. Everyone? No. Because firewalls.

The Holy Grail of WebRTC is a direct client-to-client network connection without going through an intermediary server (a relay).

TURN is an intermediary server. It's used as a fallback when peers are behind symmetric NATs.

Negotiating this, is the purpose of ICE. There are articles written on how, but in short, "ICE agents" (browsers) collaborate on both ends, communicating through your JS signaling channel, to poke holes from inside the firewall on each end to connect up.

This related answer suggests TURN usage is ~20%.

STUN is not a relay, but merely a mirror server for agents to learn their own external IPs.