A question regarding whether or not STUN is required in a completely local connection

177 views
Skip to first unread message

Neil Young

unread,
May 14, 2019, 3:54:55 PM5/14/19
to discuss-webrtc
Lately I was trying to share a connection between a MacBook and my iPhone for WebRTC using the private Wifi hotspot of iOS. That worked. Later I realised, that my iPhone was connected to the internet and could resolve STUN requests by that.

Today I tried the same with an Android device (no SIM card, no LTE) and the macBook again. Both could reach each other, the exchanged ICE candidates contained local network addresses only. The iceServer configuration of the PeerConnection was empty.

I admit, I was expecting, it would work like a charm, but it didn't. In the log of the Android device I found things like "UDP bind request failed", which reminded me to STUN, so maybe there is - even if there is no outer connection - at least an internal fallback to STUN on Android?

(For the above reasons I can't even exclude, that there is something like this for iOS too). But I would expect, that clients alone at home in a local network should be able to meed each other, w/o the help of external STUN or TURN servers.

Am I wrong?


Neil Young

unread,
May 15, 2019, 8:26:18 AM5/15/19
to discuss-webrtc
To answer my own question: Yes, there is a STUN server MANDATORY even if no is configured. I don't think this is the most intelligent solution, but it is as it is.

E/stun_port.cc: (line 284): Port[9e3de000:0:1:0:local:Net[lo:127.0.0.x/8:Loopback:id=1]]: UDP send of 96 bytes failed with error 22
E/stun_port.cc: (line 284): Port[9e3de000:0:1:0:local:Net[lo:127.0.0.x/8:Loopback:id=1]]: UDP send of 96 bytes failed with error 22

peerconnection error: ICE connection failed.

otherwise....
Reply all
Reply to author
Forward
0 new messages