For 99% of my users, LiveKit works fine, but I hav...
# ask-ai
m
For 99% of my users, LiveKit works fine, but I have 1% who are all from the same company, meaning that they're all using the same internet connection to access LiveKit. And for all of these users, I see the following error:
Copy code
Initial connection failed with ConnectionError: could not establish pc connection. Retrying with another region: <https://XXXXX.production.livekit.cloud> {"room":"XXXXXX","roomID":"XXXX","participant":"XXXXXXXX,"pID":"XXXXX"}
what does it mean and how do i fix it?
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 error "Initial connection failed with ConnectionError: could not establish pc connection. Retrying with another region" means that LiveKit was unable to establish a WebRTC peer connection between the client and the server. This is most often caused by network restrictions, such as firewalls or NAT devices blocking the necessary traffic for real-time communication. Since this issue only affects users from the same company (and thus the same network), it is likely that their corporate firewall or network configuration is blocking UDP traffic or specific ports required for WebRTC. How to resolve: • Whitelist TURN servers: If you are using LiveKit Cloud, ask the company's IT team to whitelist
*.turn.livekit.cloud
on TCP port 443. • Force TURN relay-only mode: You can configure your client to always use TURN (relay-only) by setting: `connectOpts.rtcConfig = { iceTransportPolicy: 'relay' };`This forces all traffic through TURN, which is more likely to work through strict firewalls. • Use TURN over TLS: TURN over TCP/TLS on port 443 mimics normal HTTPS traffic and is less likely to be blocked by corporate firewalls. • Test connectivity: Use the LiveKit Connection Tester tool from within the affected network to diagnose which connection types are blocked. Persistent failures across multiple regions almost always indicate local network restrictions that need to be addressed by the company's IT or network team. Sources: lib/src/exceptions.dart | CHANGELOG.md | Firewall Tips | Connecting to LiveKit | LiveKit Docs
m
Is there anywhere that I can see in the LiveKit cloud dashboard if this is why users are failing to connect?
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!
m
So the best thing I can do right now is try to use TURN to connect and make sure that the company has whitelisted any TURN servers? do i need to whitelist my own production endpoint also?
So the best thing I can do right now is try to use TURN to connect and make sure that the company has whitelisted any TURN servers? do i need to whitelist my own production endpoint also?