Is it possible to use Cloudflare SFU for the actua...
# ask-ai
e
Is it possible to use Cloudflare SFU for the actual media transport, with a self hosted instance of LIveKit?
t
Thanks for reaching out, Kevin. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you asked! LiveKit uses its own open-source SFU (Selective Forwarding Unit) for media transport, which works smoothly with both LiveKit Cloud and self-hosted setups. This means you can switch between cloud and self-hosted environments without needing to change your code—pretty convenient, right? As for Cloudflare's SFU, there's no clear information showing it can be used for media transport with a self-hosted LiveKit instance. LiveKit is built around its own SFU technology, and while Cloudflare might be involved at the DNS level, it doesn’t seem to support media transport in this particular case. Sources: LiveKit Cloud Architecture | LiveKit docs | provider/cloudflare/cloudflare.go
e
They call their service realtime SFU, and there's all kinds of docs available for it https://developers.cloudflare.com/realtime/sfu/media-transport-adapters/websocket-adapter/
t
Thank you for reaching out with your question! I wanted to share that LiveKit doesn’t natively support integration with Cloudflare Realtime SFU for media transport, including via their WebSocket adapter. LiveKit uses its own open-source SFU specifically for media transport, while WebSockets are used just for signaling, not for media transport. Both LiveKit and Cloudflare Realtime SFU are built on standard WebRTC protocols, so there might be a way to connect them indirectly through a custom gateway that bridges the two systems. However, this would involve quite a bit of custom development and isn’t a supported setup out of the box. If you’re exploring particular use cases—like replacing LiveKit’s SFU or trying to federate sessions across platforms—please feel free to share more details. I’d be happy to guide you further or suggest some alternative solutions that might work well for you. Sources: Protocol & WebRTC Stack | livekit/livekit_composite | DeepWiki | livekit/livekit_composite | DeepWiki | LiveKit Server Platform | livekit/livekit_composite | DeepWiki | Configuring firewalls | LiveKit docs | Firewall Tips
e
I'm interested in self hosting a matrix server (synapse) in my paltry home internet LAB - only 40MB upload, slow - I want to enable VOIP with some inexpensive services. I used to be able to use matrix-turnify, to use their TURN system, and it actually works great in some clients, but it doesn't work in Element X, which requires the newer matrix-rtc. I'd be interested in exploring custom code to get it done - is there a plugin API or something for LiveKit, which I could read up on to try and make something like work?
t
I'm glad you're interested in LiveKit's capabilities! LiveKit offers great extensibility through its plugin system, especially within the LiveKit Agents framework. This allows you to create custom integrations for AI services like speech-to-text and text-to-speech, and it also provides handy utilities for real-time processing, including voice activity detection and turn detection plugins. Regarding TURN services, LiveKit comes with an embedded TURN server that you can configure extensively—things like TLS/UDP port settings, relay port ranges, and built-in authentication are all supported. That said, it currently doesn’t support direct integration with external TURN services or Matrix RTC. If you’re interested in diving deeper, you can explore custom code using LiveKit’s plugin system, WebSocket signaling API, REST APIs, or even the webhook system for event-driven workflows. Please feel free to reach out if you'd like some guidance on building a custom plugin, setting up the TURN server, or looking into other integration options—I’m here to help! Sources: Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | Turn detection and interruptions | LiveKit Docs | Deploying LiveKit | LiveKit Docs | config-sample.yaml | LiveKit Server Platform | livekit/livekit_composite | DeepWiki