simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.65k stars 1.19k forks source link

Prefer use STUN server over TURN server? #292

Open maolion opened 9 years ago

maolion commented 9 years ago

We are using SimpleWebRTC for our chatting web app (Electron/Chrome), but found it seemed to prefer TURN server over STUN server. Could you please explain how should we let it try STUN server first?

xdumaine commented 9 years ago

I believe the browser decides which ICE candidates to use first, and IIRC, browsers are moving toward using TURN first for faster connection establishment, then renegotiate to STUN if possible. @fippo will know that better than I.

fippo commented 9 years ago

@xdumaine not yet, but otherwise you're correct. STUN will be used whenever possible, TURN is only the fallback. If TURN is used that means STUN could not be used.

maolion commented 9 years ago

Strange then, we tested our coTURN server under stun-only mode and the connection seemed to be good. Don't know what was going on there.

modder2 commented 9 years ago

The same problem.