HirdayGupta
HirdayGupta

Reputation: 427

Does adding more STUN servers increase the chances of WebRTC connection?

I am setting up a vanilla WebRTC project (no wrapper libraries), and I am considering what ice_servers I want to pass to my RTCPeerConnection configuration.

I have seen that there are multiple free-to-use public stun servers out there (stun.l.google.com:19302, stun2.l.google.com:19302, global.stun.twilio.com:3478, etc). Trying out these different STUN servers on the Trickle ICE STUN/TURN server verification site shows that each STUN server traverses different ports on my NAT.

So the question is, if I add more STUN servers to my configuration, does it increase the likelihood of setting up a successful p2p connection (decreasing chances of falling back on TURN)? Or does it actually somehow decrease the likelihood or negatively impact the connection setup time?

Upvotes: 0

Views: 863

Answers (1)

Philipp Hancke
Philipp Hancke

Reputation: 17360

A stun server tells you your public IP. If you ask three on them you won't get different answers. The port is always random but does not depend on the number of servers you ask.

Try adding three STUN servers at the same time on the test page. You will still only see a single candidate with type srflx.

Upvotes: 2

Related Questions