Thank you for reaching out with your question! I’d love to clarify how LiveKit handles connections. LiveKit doesn’t automatically select P2P mode for connecting users, nor does it support P2P connections directly. Instead, it’s designed around a centralized SFU (Selective Forwarding Unit) architecture, where all media flows through LiveKit servers. This approach helps ensure great scalability, low latency, and reliable performance, especially when you have larger group sessions or broadcasts.
LiveKit does a wonderful job optimizing transport protocols like UDP, TCP, and TURN/TLS based on network conditions, but it doesn’t switch to P2P mode. If your project specifically needs P2P connectivity, that would need to be set up separately, outside of LiveKit’s main features. I hope this helps clarify things! Please feel free to ask if you have any more questions or need further assistance.
Sources:
How We Built a Globally Distributed WebRTC Mesh Network |
Decentraland's Catalyst: using WebRTC to interact in the metaverse |
Connecting to LiveKit | LiveKit Docs |
pkg/rtc/transportmanager.go