brief-raincoat-81365
04/01/2026, 2:47 PMturns: on TCP 443
Media works for ~10 seconds (audio + video both directions)
1. Then: dtls timeout: read/write timeout: context deadline exceeded
2. Video freezes, signaling stays connected
Same-node connections work perfectly. Issue only occurs in cross-node scenarios.
What we tried
packet_buffer_size_video: 5000, packet_buffer_size_audio: 2000
• OS UDP buffers increased to 5MB (rmem_max, wmem_max)
• Confirmed TCP 7881 connectivity between nodes
• RTT ~130ms between client and TURN server
TURN Config
turn:
enabled: true
tls_port: 3478
udp_port: 443
Q*uestions*
1. Is there a configurable DTLS timeout or keepalive interval for high-latency TURN/TCP scenarios?
2. We’re using Contour/Envoy as a reverse proxy for TLS termination (WSS) and TLS passthrough (TURN). Could this be causing the DTLS timeout? What reverse proxy setup do you recommend for self-hosted on-prem deployments?
3. For those running multi-node LiveKit on-prem — what does your production setup look like in terms of reverse proxy, TURN, and TLS? Any gotchas with high-latency cross-region TURN/TCP?
4. Any recommended configuration for self-hosted multi-node deployments with 100ms+ RTT between client and TURN?flat-photographer-63184
04/01/2026, 6:07 PMflat-photographer-63184
04/01/2026, 6:07 PMflat-photographer-63184
04/01/2026, 6:09 PMWSS signaling connects fine (proxied via Qatar → Germany) - is the connection to german region via a private network?brief-raincoat-81365
04/01/2026, 7:00 PMUDP traffic: We've confirmed UDP is open on the GCP side (ports 50000-60000 and UDP 443). However, the on-prem Germany node is behind a FortiGate firewall — inbound UDP from the internet is blocked, which is why the client falls back to TURN/TCP. Within the same node, direct UDP works fine.
Reason for two regions: We serve users in both Europe and the Gulf region. Latency from the Gulf to Germany is ~130ms, so we wanted a closer node in Qatar for Gulf-based users to reduce latency for Gulf-only calls.
Signaling proxy: Yes, the two nodes are connected via a WireGuard VPN tunnel (private network). When a Gulf user connects to the Qatar node via WSS, but the room is hosted on the Germany node, LiveKit's built-in signaling bridge proxies the WebSocket messages from Qatar to Germany over this private network. The signaling part works — the participant appears in the room and we can see them briefly. The issue is specifically with the media/DTLS layer timing out after ~10 seconds.
So the flow is:
Gulf client → WSS → Qatar node (public) → signaling proxy via WireGuard → Germany node (room host)
Gulf client → TURN/TCP 443 → Germany TURN server → media (works ~10s then DTLS timeout)
The client is forced to use TURN/TCP to reach Germany because direct UDP is blocked by the firewall.brief-raincoat-81365
04/01/2026, 9:41 PM<http://livekit-gulf.domain.com|livekit-gulf.domain.com> → HAProxy TLS termination → LiveKit WSS (7880)
- SNI <http://livekitturn-gulf.domain.com|livekitturn-gulf.domain.com> → HAProxy TLS passthrough → LiveKit TURN (3478)
- UDP 443 → LiveKit TURN UDP (direct, no proxy)
Key: HAProxy with 86400s timeout + direct TLS passthrough for TURN fixed the issue. Envoy was apparently dropping the TURN/TCP connection after ~10 seconds.
Cross-region now works: one participant from Germany (direct), one from Gulf via TURN/TCP through the Germany node — no freezing, stable audio/video.
---
Follow-up question: In our current setup, all participants in a mixed-region room end up on the same node (the room's host node). The Gulf participant connects via TURN/TCP to the Germany node rather than having media served locally from the Qatar node.
Is there any way in self-hosted LiveKit to achieve true distributed SFU — where each participant connects to their nearest node and media is relayed between nodes? Or is this exclusively a LiveKit Cloud feature?
We'd love to keep self-hosting but this capability would significantly improve latency for our Gulf users in mixed-region calls.flat-photographer-63184
04/02/2026, 6:03 AMbrief-raincoat-81365
04/02/2026, 6:06 AMflat-photographer-63184
04/02/2026, 6:09 AMremote participant joins via TURN/TCP through signaling proxybrief-raincoat-81365
04/02/2026, 6:11 AMflat-photographer-63184
04/02/2026, 6:12 AM