Skip to content

Media over QUIC at Cloudflare

Last updated View as MarkdownAgent setup

MoQ (Media over QUIC) is a protocol for delivering live media content using QUIC transport. It provides efficient, low-latency media streaming by leveraging QUIC's multiplexing and connection management capabilities.

MoQ is designed to be an Internet infrastructure level service that provides media delivery to applications, similar to how HTTP provides content delivery and WebRTC provides real-time communication.

Cloudflare currently supports draft-14 and draft-16 of the MoQ Transport specification. For a full breakdown of supported messages per draft, refer to MoQ Feature Matrix.

For the most up-to-date documentation on the protocol, please visit the IETF working group documentation.

Get started

Cloudflare MoQ relays are available through the Cloudflare dashboard and the API. They are free to use during the beta period.

Provision a relay

Each relay provides an isolated scope — your namespaces, tracks, and objects are separated from those belonging to other relays. You control who can publish and who can subscribe by issuing tokens scoped to the operations each client needs.

To create a relay via the API:

curl -X POST \
  "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/moq/relays" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Relay"}'

Cloudflare returns a relay ID and two default tokens: one that can publish and subscribe, and one that can only subscribe. Token secrets are shown once in the response and never stored.

You can also create and manage relays in the Cloudflare dashboard under Media > Realtime > MoQ Relay.

Connect a publisher and subscriber (draft-16)

Draft-16 requires authentication. Clients send a token in the URL path when opening a MoQ session. Using the open-source moq-rs tools:

Publisher:

ffmpeg -stream_loop -1 -re -i input.mp4 \
  -f mp4 -movflags empty_moov+frag_every_frame+separate_moof+omit_tfhd_offset - \
  | moq-pub --name my-namespace \
    "https://draft-16.cloudflare.mediaoverquic.com/<publish_subscribe_token>"

Subscriber:

moq-sub --name my-namespace \
  "https://draft-16.cloudflare.mediaoverquic.com/<subscribe_token>" \
  | ffplay -hide_banner -

Connect a publisher and subscriber (draft-14)

Draft-14 clients connect to:

https://draft-14.cloudflare.mediaoverquic.com/

Test draft-18

Cloudflare is working on draft-18 support ahead of a global deployment. To test against a draft-18 relay in the meantime, refer to moq-interop-runner.

Was this helpful?