Skip to content

Realtime SFU

Last updated View as MarkdownAgent setup

Connect devices, applications, and AI with real-time media and data.

Cloudflare Realtime SFU (Selective Forwarding Unit) routes WebRTC audio, video, and DataChannels between your endpoints. Your application chooses who publishes, who subscribes, and who can send controls back.

WebRTC provides connections for live media and messages. Each endpoint connects to the SFU, which forwards its publications to the subscribers your application selects.

Use standard HTTPS APIs and WebRTC from browsers, embedded firmware, native applications, and servers. Your signaling backend can run on Workers, in a container, or on your existing infrastructure.

Get started

Explore examples

What you can build

Embedded devices

Send audio and telemetry from an ESP32 to browsers, with controls for one authorized operator. Use the same design for robot gateways.

Cloud gaming

Stream a game from a Container to browsers, then send keyboard and pointer input back over DataChannels.

AI audio pipelines

Transcribe microphone audio with Workers AI, then send generated speech to browsers through WebSocket media adapters.

For a video conferencing application, start with RealtimeKit. It provides meeting SDKs, participant management, and customizable UI components. Choose Realtime SFU when you need direct control over WebRTC connections, media routing, and signaling.

For a browser-first introduction, run a custom video room. You can also compose interactive broadcasts, remote inspection tools, and media-processing applications from the same primitives.

How the pieces fit together

Your endpoints exchange media and DataChannels with Realtime SFU. A separate application backend authenticates users and devices, calls the SFU API, and shares the track identifiers that endpoints need.

Browser, device, or native endpoint
WebRTC media and DataChannels
Realtime SFU
Application signaling
HTTPS API
Your backend
Application state

The backend holds the SFU App Secret and manages application state and permissions. Refer to application architecture for the responsibilities and trust boundaries.

Choose a starting point

You want to Start with
Run a working application Get started
Understand connections, publications, and subscriptions Sessions and tracks
Implement your own media or messaging endpoint Connection patterns
Add messages, video quality selection, or a media adapter Features
Look up an API operation or request body Connection API
Diagnose a connection or media problem Observability

For a coding agent, start with the SFU documentation index. It links to the task guides and API reference.

The examples collection identifies each application's requirements and limitations. Refer to pricing and limits when planning your integration.

Was this helpful?