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.
Full documentation lives at doc.moq.dev.
| I want to | Start here |
|---|---|
| Try MoQ | Local demo or live web demo |
| Add streaming to an app | Choose a library and find an example |
| Connect existing media tools | CLI, OBS, GStreamer, and gateways |
| Run a relay | Install, then production setup |
| Understand the design | Concepts and protocol drafts |
| Diagnose a problem | Troubleshooting and inspect a relay |
| Change this repository | Repository map, development guide, and contributing |
| Work with a coding agent | Agent setup; repository instructions start in AGENTS.md |
The quickest way to see it in action (requires Nix with flakes):
# Runs a relay, demo media, and the web server
nix develop -c justIt opens the watch, publish, and stats pages in your browser, or visit http://localhost:5173/watch.html. Don't have Nix? See the demo guide for manual setup.
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.
└─────────────────┘
Choose by the job you need done. The library guide compares languages; the repository map locates the implementation behind each feature.
| Layer | Rust | TypeScript |
|---|---|---|
| Live pub/sub | moq-net | @moq/net |
| Media catalog and containers | hang, moq-mux | @moq/hang |
| Capture and playback | moq-audio, moq-video | @moq/publish, @moq/watch |
| Rooms and chat | moq-room | @moq/room |
| Authorization | moq-auth | @moq/auth |
The Rust core also has Python, Swift, Kotlin, Go, Dart, C++, and C bindings. Layers maps their namespaces.
Start with the layering overview, then use the Internet-Drafts index for the wire and format specifications. Their editable sources live in drafts/.
The release branch is stable and is what gets published; main is the trunk where breaking API changes land between releases.
Every package follows semver: a breaking API change bumps the first nonzero version number (1.2.0 to 2.0.0, 0.3.1 to 0.4.0, 0.0.5 to 0.0.6).
Breaking wire changes are extremely rare.
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 --list
# Build everything
just build
# Lint, compile, and test 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 --allPRs into main get no cloud CI until the merge queue, so run just ci before pushing. It runs what the queue runs, the same ground as just check, plus two settings: MOQ_STRICT=1, which turns a missing tool into an error instead of a skipped check, and NEXTEST_PROFILE=ci, which allows a longer hang timeout.
See the development guide and the justfile for more.
Licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
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. moq-c and the other moq crates remain MIT/Apache.