Overriding iceTransportPolicy: 'relay' still triggers iOS Local Network Access prompt in React Native LiveKitRoom
Describe the bug
When using LiveKitRoom in React Native and passing connectOptions={{ rtcConfig: { iceTransportPolicy: 'relay' } }}, the iOS app still prompts the user for Local Network Access. This happens even though relay-only should avoid usage of local (host) or reflexive candidates.
To Reproduce
- Wrap LiveKitRoom with props including:
connectOptions={{ rtcConfig: { iceTransportPolicy: 'relay' } }}
-
Launch TestFlight build on a real iOS device
-
Observe the “Would Like to Find and Connect to Devices on Your Local Network” prompt
-
reject the prompt and connection fails
Expected behavior
The prompt should not appear, because relay-only mode should avoid any local network candidate usage.
If the OS still requires the permission (because of internal probing), the SDK should provide a clear fallback or error message explaining why the prompt is needed.
We are working on it.
From https://groups.google.com/g/discuss-webrtc/c/CwXK55Y2sb8/m/61yyeCXfCAAJ, WebRTC might enumerate the network interface under the hood, that might trigger such permission prompt on IOS 14.
As some technical context: Starting with iOS 14, Apple introduced a system-level privacy permission: “App Would Like to Find and Connect to Devices on Your Local Network” This prompt is triggered any time your app attempts to: Send multicast or broadcast traffic (like mDNS or SSDP) Connect directly to a private IP (like 192.168.x.x or 10.x.x.x) Probe the local network (e.g., via ICE candidates in WebRTC)
We are trying to verify it internally, please stay tuned.
@CoryDuan are you able to reproduce this with LiveKit Cloud? I don't believe it's an issue there
@davidliu https://github.com/elevenlabs/packages/issues/140#issuecomment-3397271652 This might help
Also facing this issue. The local network access request pops up right before the first call, often cutting off the audio. Most users are also declining the permission request, resulting in a totally silent call.
@coryetzkorn are you on LiveKit Cloud or your own self-hosted server?
If you're self-hosting:
- Ensure your config file contains the following setting:
rtc:
use_external_ip: true
external_ip_only: true
- Verify the server logs to ensure that local ips are not emitted to the clients as ice candidates.
{
"room":"test_room",
"roomID":"RM_xxx",
"participant":"test_participant",
"pID":"PA_xxx",
"remote":false,
"publisherCandidates":[
"[local][selected:1][trickle] udp4 host 188.166.x.x:x (resolved: 188.166.x.x:x)",
"[local][trickle] tcp4 host 188.166.x.x:7881 (resolved: 188.166.x.x:7881)",
"[local][trickle] udp4 host 10.15.0.5:54995 (resolved: 10.15.0.5:54995)", <-- these local addresses should not be here
"[local][trickle] tcp4 host 10.15.0.5:7881 (resolved: 10.15.0.5:7881)", <--
"[local][trickle] udp4 host 10.104.0.2:52450 (resolved: 10.104.0.2:52450)", <--
"[local][trickle] tcp4 host 10.104.0.2:7881 (resolved: 10.104.0.2:7881)", <--
"[remote][trickle] udp4 host 192.168.11.9:55155", <-- remote local addresses are fine
"[remote][trickle] udp4 host 192.168.11.9:49997",
"[remote][trickle] tcp4 host 192.168.11.9:58875",
"[remote][selected:1] udp4 prflx 210.128.x...:x"
],
"subscriberCandidates":[
"[local][selected:1][trickle] udp4 host 188.166.x.x:x (resolved: 188.166.x.x:x)",
"[local][trickle] tcp4 host 188.166.x.x:7881 (resolved: 188.166.x.x:7881)",
"[local][trickle] udp4 host 10.15.0.5:56149 (resolved: 10.15.0.5:56149)", <-- these local addresses should not be here
"[local][trickle] tcp4 host 10.15.0.5:7881 (resolved: 10.15.0.5:7881)", <--
"[local][trickle] udp4 host 10.104.0.2:52449 (resolved: 10.104.0.2:52449)", <--
"[local][trickle] tcp4 host 10.104.0.2:7881 (resolved: 10.104.0.2:7881)", <--
"[remote][trickle] udp4 host 192.168.11.9:58166", <-- remote local addresses are fine
"[remote][trickle] tcp4 host 192.168.11.9:58871",
"[remote][selected:1] udp4 prflx 210.128.x...:58166"
],
"connectionType":"udp",
...
}
@davidliu Thanks. I'm connecting via the ElevenLabs package, which is a wrapper around LiveKit. Looks like maybe the ElevenLabs library needs to be updated to take this config.
https://github.com/elevenlabs/packages/issues/140#issuecomment-3397271652
Closing since https://github.com/elevenlabs/packages/issues/140 has been closed.