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.
- Run the demo - try MoQ locally with a relay, demo media, and the web UI.
- 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 justThen visit https://localhost:8080. 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.
βββββββββββββββββββ
This repository provides both Rust and TypeScript libraries with similar APIs but language-specific optimizations.
| Crate | Description | Docs |
|---|---|---|
| moq-net | The networking layer: real-time pub/sub with built-in caching, fan-out, and prioritization. Negotiates either the moq-lite or moq-transport wire protocol. |
|
| moq-relay | A clusterable relay server. This relay performs fan-out connecting multiple clients and servers together. | |
| moq-token | An authentication scheme supported by moq-relay. Can be used as a library or as a CLI to authenticate sessions. |
|
| moq-native | Opinionated helpers to configure a Quinn QUIC endpoint. It's harder than it should be. | |
| libmoq | C bindings for moq-net. |
|
| hang | Media-specific encoding/streaming layered on top of moq-net. Can be used as a library. |
|
| moq-cli | A CLI for publishing media to MoQ relays. | |
| moq-mux | Media muxers and demuxers (fMP4/CMAF, HLS) for importing content into MoQ broadcasts. | |
| moq-gst | A GStreamer plugin for publishing or consuming MoQ broadcasts. Not built by default; requires GStreamer dev libraries. |
| Package | Description | NPM |
|---|---|---|
| @moq/net | The 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. |
|
| @moq/token | Authentication library & CLI for JS/TS environments (see Authentication) | |
| @moq/hang | Core media library: catalog, container, and support. Shared by @moq/watch and @moq/publish. |
|
| @moq/demo | Examples using @moq/hang. |
|
| @moq/watch | Subscribe to and render MoQ broadcasts (Web Component + JS API). | |
| @moq/publish | Publish media to MoQ broadcasts (Web Component + JS API). | |
| @moq/ui-core | Shared UI components (Button, Icon, Stats, CSS theme) used by @moq/watch/ui and @moq/publish/ui. |
Read the specifications:
# See all available commands
just
# Build everything
just build
# Run tests and linting
just check
# Automatically fix some linting errors
just fixSee 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)