what do these results from the livekit connection ...
# ask-ai
m
what do these results from the livekit connection test mean? i see a warning in there: Connecting to signal connection via WebSocket Connected to server, version 1.9.0. LiveKit Cloud: US West B Establishing WebRTC connection udp [2603c0201ab7003371fa7f36aebe0]50015 host udp 161.115.176.243:50015 host tcp 161.115.176.243:7881 host (passive) tcp [2603c0201ab7003371fa7f36aebe0]7881 host (passive) udp [2603c0201ab7003371fa7f36aebe0]50001 host udp 161.115.176.243:50001 host tcp 161.115.176.243:7881 host (passive) tcp [2603c0201ab7003371fa7f36aebe0]7881 host (passive) Warning: error with ICE candidate: 701 STUN host lookup received error. stunip 161 115 176 243.host.livekit.cloud3478 Can connect via TURN Can publish audio detected audio from microphone published 158 audio packets Can publish video received video frames published 952 video packets Resuming connection after interruption Pass
t
Thanks for reaching out, Jackson. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The warning "error with ICE candidate: 701 STUN host lookup received error" means there was a problem performing a STUN server lookup during the ICE (Interactive Connectivity Establishment) process. This can happen if your network blocks or restricts STUN traffic, which is used to establish direct peer-to-peer connections. However, since your test results show "Can connect via TURN" and "Pass", connectivity is not impacted. LiveKit automatically falls back to using TURN relay servers when direct connections via STUN/ICE are unavailable. This ensures users can still join and participate in rooms reliably. • Connectivity will work as expected, but traffic will be relayed through TURN servers instead of direct peer-to-peer. • This may add some latency and increase bandwidth usage, but does not prevent successful connections. The fallback mechanism is working as designed, so you can safely ignore this warning unless you specifically require direct peer-to-peer connections for optimal performance. Sources: src/connectionHelper/checks/turn.ts | Connecting to LiveKit | LiveKit Docs | Firewall Tips
m
Forcing TURN for Firewall-Sensitive Users You can force clients to always use TURN (relay-only) by setting:
Copy code
connectOpts.rtcConfig = { iceTransportPolicy: 'relay' };
Even when forcing TURN, clients may still end up connecting to the TURN server embedded in the media node (which uses UDP) and may still face the same issue where UDP is blocked. Future work includes allowing clients to force TURN/TLS. If i do this, do i need to set it in my frontend app?
t
Hey there! Let me help you understand how to ensure your clients always use TURN (relay-only). You've got two great options here. First, you can set
iceTransportPolicy: 'relay'
right in your frontend app's
connectOpts.rtcConfig
. Think of this like a personal preference for your specific application. If you want something a bit more universal, LiveKit also offers a server-side setting called
clientConfiguration.forceRelay
that basically says "hey, everyone's using TURN relay, no exceptions!" This will override any client-side settings, so it's super powerful. • Want client-specific control? Go with
iceTransportPolicy: 'relay'
in your frontend. • Need to make sure ALL clients use TURN relay? The server-side
forceRelay
setting is your new best friend. Most of the time, the frontend setting works like a charm. But if you really need to lock things down server-side, you've got that option too! Sources: livekit-android-sdk/src/main/java/io/livekit/android/room/RTCEngine.kt | src/room/RTCEngine.ts | Firewall Tips | lib/src/types/other.dart | Sources/LiveKit/Core/Room+Engine.swift
m
Can that server-side setting be configured through the LiveKit cloud dashboard?
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!