RT Realtime Lab
Cloudflare Realtime + GCP Coturn

Learn SFU and TURN by watching the plumbing, not hiding it.

This lab teaches the boundary between direct peer-to-peer WebRTC, TURN relays, and an SFU. Each demo exposes the primitive objects you actually work with: sessions, tracks, ICE servers, candidate pairs, and simulcast layers.

Teaching order
  1. See host/STUN connectivity succeed when relay is not forced.
  2. Force relay-only and watch STUN fail.
  3. Repeat with Cloudflare TURN and self-hosted coturn.
  4. Publish media to an SFU, then pull tracks back yourself.
  5. Measure datachannels and manually switch simulcast layers.
Mental model

TURN gives you connectivity. SFU gives you fan-out and routing. RealtimeKit adds the product layer on top: rooms, participants, presets, recordings, webhooks, UI components, and meeting logic.

New

RealtimeKit Showcase

Mint real meeting tokens against the lab’s RealtimeKit app, then launch the hosted Cloudflare examples for group calls, custom UIs, audio rooms, chats, waiting rooms, breakout controls, livestreams, recordings, transcripts, and more.

Open RealtimeKit Showcase
Demo 1

TURN Lab

Run a local two-peer WebRTC session in the browser, compare direct connectivity with relay-only behavior, and inspect the selected ICE candidate pair in real time.

Open TURN Lab
Demo 2

SFU Echo

Push your camera and mic to Cloudflare Realtime, then pull those same tracks into a second session so the pub/sub track model becomes concrete.

Open SFU Echo
Demo 3

SFU DataChannels

Build the minimal one-way channel topology Cloudflare Realtime uses, then add the reverse direction explicitly so the one-way constraint is obvious instead of theoretical.

Open DataChannels Demo
Demo 4

SFU Simulcast

Publish three video encodings and switch the subscriber between quality layers using the track update API. This is where the SFU stops being “just a room server”.

Open Simulcast Demo

What TURN Actually Does

  • Allocates a public relay address when NAT or firewall rules block direct paths.
  • Lets you force relay-only connections to prove your fallback path works before users need it.
  • Supports UDP, TCP, and usually TLS-over-TCP when browsers or networks are restrictive.
  • Does not give you fan-out, routing logic, or participant state.

What an SFU Adds

  • One publisher can serve many subscribers without each peer encoding for every viewer.
  • Tracks become addressable primitives you can save, share, and subscribe to from your own backend.
  • Datachannels and simulcast ride the same session model.
  • Cloudflare Realtime stays intentionally low-level: you provide the room and presence logic.