Media over QUIC

August 8, 2026 ยท View on GitHub

Media over QUIC

License Discord Crates.io npm

Media over QUIC

Media over QUIC (MoQ) is a next-generation live media protocol that provides real-time latency at massive scale. Built using modern web technologies, MoQ delivers WebRTC-like latency without the constraints of WebRTC. The core networking is delegated to a QUIC library but the rest is in application-space, giving you full control over your media pipeline.

Key Features:

  • ๐Ÿš€ Real-time latency using QUIC for prioritization and partial reliability.
  • ๐Ÿ“ˆ Massive scale designed for fan-out and supports cross-region clustering.
  • ๐ŸŒ Modern Web using WebTransport, WebCodecs, and WebAudio.
  • ๐ŸŽฏ Multi-language with both Rust (native) and TypeScript (web) libraries.
  • ๐Ÿ”ง Generic for any live data, not just media. Includes text chat as both an example and a core feature.

Note: This project implements moq-lite, a forwards-compatible subset of the IETF moq-transport draft. moq-lite works with any moq-transport CDN (ex. Cloudflare). The focus is narrower, prioritizing simplicity and deployability.

Getting Started

Full documentation lives at doc.moq.dev.

  • Run the demo - try MoQ locally with a relay, demo media, and the web UI.
  • Agent setup - teach your AI coding agent (Claude Code, Cursor, etc.) how to build with MoQ.
  • Linux packages - install the relay and GStreamer plugin from apt.moq.dev / rpm.moq.dev.
  • Production setup - deploy a relay with a real domain and TLS.

The quickest way to see it in action (requires Nix with flakes):

# Runs a relay, demo media, and the web server
nix develop -c just

Then visit https://localhost:8080. Don't have Nix? See the demo guide for manual setup.

Architecture

MoQ is designed as a layered protocol stack.

Rule 1: The CDN MUST NOT know anything about your application, media codecs, or even the available tracks. Everything could be fully E2EE and the CDN wouldn't care. No business logic allowed.

Instead, moq-relay operates on rules encoded in the moq-net header. These rules are based on video encoding but are generic enough to be used for any live data. The goal is to keep the server as dumb as possible while supporting a wide range of use-cases.

The media logic is split into another protocol called hang. It's pretty simple and only intended to be used by clients or media servers. If you want to do something more custom, then you can always extend it or replace it entirely.

Think of hang as like HLS/DASH, while moq-lite is like HTTP.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Application   โ”‚   ๐Ÿข Your business logic
โ”‚                 โ”‚    - authentication, non-media tracks, etc.
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      hang       โ”‚   ๐ŸŽฌ Media-specific encoding/streaming
โ”‚                 โ”‚     - codecs, containers, catalog
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”œ
โ”‚    moq-lite     โ”‚  ๐ŸšŒ Generic pub/sub transport
โ”‚                 โ”‚     - broadcasts, tracks, groups, frames
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  WebTransport   โ”‚  ๐ŸŒ Browser-compatible QUIC
โ”‚      QUIC       โ”‚     - HTTP/3 handshake, multiplexing, etc.
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Libraries

This repository provides both Rust and TypeScript libraries with similar APIs but language-specific optimizations.

Rust

CrateDescriptionDocs
moq-netThe networking layer: real-time pub/sub with built-in caching, fan-out, and prioritization. Negotiates either the moq-lite or moq-transport wire protocol.docs.rs
moq-relayA clusterable relay server. This relay performs fan-out connecting multiple clients and servers together.
moq-tokenAn authentication scheme supported by moq-relay. Can be used as a library or as a CLI to authenticate sessions.
moq-nativeOpinionated helpers to configure a Quinn QUIC endpoint. It's harder than it should be.docs.rs
libmoqC bindings for moq-net.docs.rs
hangMedia-specific encoding/streaming layered on top of moq-net. Can be used as a library.docs.rs
moq-cliA CLI for publishing media to MoQ relays.
moq-muxMedia muxers and demuxers (fMP4/CMAF, HLS) for importing content into MoQ broadcasts.docs.rs
moq-gstA GStreamer plugin for publishing or consuming MoQ broadcasts. Not built by default; requires GStreamer dev libraries.

TypeScript

PackageDescriptionNPM
@moq/netThe networking layer: real-time pub/sub with built-in caching, fan-out, and prioritization. Negotiates either the moq-lite or moq-transport wire protocol. Intended for browsers, runs server-side with a WebTransport polyfill.npm
@moq/tokenAuthentication library & CLI for JS/TS environments (see Authentication)npm
@moq/hangCore media library: catalog, container, and support. Shared by @moq/watch and @moq/publish.npm
@moq/demoExamples using @moq/hang.
@moq/watchSubscribe to and render MoQ broadcasts (Web Component + JS API).npm
@moq/publishPublish media to MoQ broadcasts (Web Component + JS API).npm
@moq/ui-coreShared UI components (Button, Icon, Stats, CSS theme) used by @moq/watch/ui and @moq/publish/ui.npm

Protocol

Read the specifications:

Development

Contributions are welcome, including AI-assisted issues, pull requests, reviews, and comments. See CONTRIBUTING.md for the attribution policy and guidance on when to open an issue before writing code.

# See all available commands
just

# Build everything
just build

# Lint and compile what your branch changed
just check

# Automatically fix some linting errors, same scope
just fix

# Same as the above, over every package
just check-all
just fix-all

See the development guide and the justfile for more.

License

Licensed under either:

Exception: the OBS plugin under cpp/obs/ is licensed under GPL-2.0-or-later (see cpp/obs/LICENSE), because it links OBS Studio's libobs, which is GPL-2.0. This is a separately-distributable work; per GPLv2 its presence in this repository is mere aggregation and does not affect the MIT/Apache licensing of the rest of the project. libmoq and the other moq crates remain MIT/Apache.