Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion demo/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@moq/json": "workspace:^",
"@moq/publish": "workspace:^",
"@moq/room": "workspace:^",
"@moq/watch": "workspace:^"
"@moq/watch": "workspace:^",
"@moq/net": "workspace:^",
"@moq/signals": "workspace:^"
},
"//devDependencies": "These are only needed for local development with workspace packages. They are NOT needed when using the published npm packages.",
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion demo/web/src/meet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

import "@moq/publish/support/element";
import "@moq/watch/support/element";
import { Local, type Member, Net, Publish, Room, Signals } from "@moq/room";
import * as Net from "@moq/net";
import * as Publish from "@moq/publish";
import { Local, type Member, Room } from "@moq/room";
import * as Signals from "@moq/signals";

const RELAY_URL = import.meta.env.VITE_RELAY_URL ?? "http://localhost:4443";

Expand Down
5 changes: 3 additions & 2 deletions doc/bin/relay/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ renewal keeps the current certificate serving and retries.

## \[stun]

Applications can use the relay as an explicitly selected STUN server for WebRTC
ICE. The listener has its own UDP port and is disabled unless configured:
Build with `cargo install moq-relay --features stun` to use the relay as an
explicitly selected STUN server for WebRTC ICE. This feature is off by default.
The listener has its own UDP port and is disabled unless configured:

```toml
[stun]
Expand Down
4 changes: 1 addition & 3 deletions doc/bin/rtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ under a fresh [epoch](/concept/moq-lite#publisher-epochs), so a publisher that
reconnects while its stale session lingers replaces it at once.

Built on [str0m](https://crates.io/crates/str0m); the library is
[`moq-rtc`](https://docs.rs/moq-rtc). Embedders can sample each peer's
[wire source](https://github.com/moq-dev/moq/blob/main/rs/moq-ice/src/wire.rs) for UDP
payload bytes, including media, control traffic, and retransmissions.
[`moq-rtc`](https://docs.rs/moq-rtc).
6 changes: 4 additions & 2 deletions doc/concept/transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ See [stream listeners](/bin/relay/auth#stream-listeners).

## WebRTC data channels (experimental)

Applications that already negotiate a browser `RTCPeerConnection` can pass an
The private workspace P2P transport is exercised by `test/p2p`; it is not a
published package. Applications in this checkout that negotiate a browser
`RTCPeerConnection` can pass an
[`@moq/p2p` transport](https://github.com/moq-dev/moq/tree/main/js/p2p) to
`@moq/net`'s connect or accept. One reliable ordered data channel carries qmux
records, with no datagrams. The application supplies signaling and ICE and
keeps ownership of the peer connection; closing the transport closes only its
channel. SCTP ordering means one lost packet can hold back every stream.

Native peers use `moq-tokio`'s `webrtc` feature, which runs its own ICE agent:
Native peers can opt into `moq-tokio`'s internal `webrtc` feature, which runs its own ICE agent:
host candidates on every interface, server-reflexive candidates from the STUN
servers it is given, and mDNS resolution of a browser's `.local` candidates.
The application still carries the offer, answer, and candidates; the offering
Expand Down
6 changes: 3 additions & 3 deletions doc/lib/rs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ see [Applications](/bin/). [Examples](/setup/examples) links runnable consumers;
| [moq-tokio](https://docs.rs/moq-tokio) | Connects and listens over QUIC, WebSocket, or iroh, from config or CLI flags. Its `driver` feature alone is a tokio QUIC stack without MoQ. |
| [qmux](https://docs.rs/qmux) | QUIC streams, datagrams, and flow control over TCP, TLS, WebSocket, and Unix sockets, on moq-quic's state machine. |
| [moq-sock](https://docs.rs/moq-sock) | Socket binding and CPU pinning for thread-per-core listeners. |
| [moq-ice](https://github.com/moq-dev/moq/tree/main/rs/moq-ice) | The ICE agent behind native WebRTC: drives a str0m connection over UDP, with a STUN client. |
| [moq-ice](https://github.com/moq-dev/moq/tree/main/rs/moq-ice) | Internal infrastructure with no stability promise; the ICE agent behind native WebRTC: drives a str0m connection over UDP, with a STUN client. |
| [moq-uring](https://docs.rs/moq-uring) | Experimental Linux io\_uring server for moq-lite. |
| [hang](/lib/rs/hang) | The media layer: catalog, containers, ordered frame delivery. |
| [moq-mux](/lib/rs/moq-mux) | Import and export fMP4/CMAF, MPEG-TS, Matroska, FLV, and Annex-B. |
Expand All @@ -33,10 +33,10 @@ see [Applications](/bin/). [Examples](/setup/examples) links runnable consumers;
| [moq-audio](/lib/rs/moq-audio) | Microphone and speaker, Opus/PCM/AAC codecs, echo cancellation. |
| [moq-transcode](https://docs.rs/moq-transcode) | Just-in-time rendition ladders, GPU-resident on NVIDIA. |
| [moq-auth](/lib/rs/moq-auth) | Relay authorization: JWT signing and verification, and the auth server contract. |
| [moq-room](/lib/rs/moq-room) | Headless rooms: announce-derived roster, token claims, and a chat track. |
| [moq-room](/lib/rs/moq-room) | Workspace-only native rooms; use the published JS room API for applications. |
| [moq-json](/lib/rs/moq-json) | JSON over tracks: snapshots with merge-patch deltas, or append logs. |
| [moq-flate](/lib/rs/moq-flate) | Opaque payloads over tracks, optionally compressed with group-scoped DEFLATE: snapshots or append logs. |
| [moq-e2ee](https://docs.rs/moq-e2ee) | End-to-end encryption of groups, datagrams, and track names, scoped to a publisher epoch. |
| [moq-e2ee](https://github.com/moq-dev/moq/tree/main/rs/moq-e2ee) | Workspace-only end-to-end encryption of groups, datagrams, and track names, scoped to a publisher epoch. |
| [moq-loc](https://docs.rs/moq-loc), [moq-msf](https://docs.rs/moq-msf) | The IETF LOC container and MSF catalog. |
| [moq-stats](https://docs.rs/moq-stats) | Publish and consume relay traffic counters as tracks. |
| [moq-clock](/lib/rs/moq-clock) | One clock for time and timers on tokio, the browser, and a deterministic test simulator. |
Expand Down
42 changes: 5 additions & 37 deletions doc/lib/rs/moq-room.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,11 @@
---
title: moq-room
description: Headless multi-participant rooms over MoQ
description: Native room implementation in the workspace
---

# moq-room

[![crates.io](https://img.shields.io/crates/v/moq-room)](https://crates.io/crates/moq-room)
[![docs.rs](https://docs.rs/moq-room/badge.svg)](https://docs.rs/moq-room)

The native twin of [`@moq/room`](/lib/js/room). A room is a path prefix. There
is no service and no storage: joining is minting a moq-auth token rooted at that
prefix and dialing the relay. Participants are discovered from the announce
stream. Identity is the path before `camera.hang` / `screen.hang`.

Each participant publishes `{identity}/camera.hang` (camera + mic) and
`{identity}/screen.hang` (screenshare; its announce/unannounce is the share
lifecycle). Capture and encode stay in [`moq-video`](/lib/rs/moq-video) and
[`moq-audio`](/lib/rs/moq-audio).

```bash
cargo add moq-room
```

```rust
use moq_net::Path;
use moq_room::{Kind, Room, claims};

let token = key.sign(&claims("meet/demo", "alice")?)?;
let origin = moq_tokio::origin::spawn();
let mut room = Room::new(&origin.consume(), Some(Path::new("alice").to_owned()));
while let Some(event) = room.next().await {
if event.kind == Kind::Camera {
// event.broadcast is the live broadcast, or None once it goes offline.
}
}
```

Chat is `moq_room::chat`: a JSON window track named `chat` that keeps ten
seconds of messages. It is not hang.live's `hang/chat.json` catalog extension.

Gossip, tickets, and 1:1 calls stay in iroh-live. API:
[docs.rs/moq-room](https://docs.rs/moq-room).
The native room implementation is workspace-only and is not published.
Use [`@moq/room`](/lib/js/room) for the published room API.
The [Rust source](https://github.com/moq-dev/moq/tree/main/rs/moq-room)
contains the native implementation and its tests.
2 changes: 2 additions & 0 deletions js/p2p/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @moq/p2p

Private workspace package, exercised by `test/p2p`; it is not published.

A WebTransport-shaped MoQ transport over one reliable ordered WebRTC data channel.
Applications own signaling, ICE configuration, admission, and the `RTCPeerConnection`.
The transport owns its data channel. Closing it leaves the peer connection open.
Expand Down
6 changes: 3 additions & 3 deletions js/p2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"scripts": {
"build": "rimraf dist && tsc -b tsconfig.build.json && bun ../common/package.ts",
"check": "tsc --noEmit && tsc --noEmit --project bench/tsconfig.json",
"test": "bun test --only-failures",
"release": "bun ../common/release.ts"
"test": "bun test --only-failures"
},
"dependencies": {
"@moq/qmux": "workspace:^"
Expand All @@ -27,5 +26,6 @@
"@typescript/lib-dom": "npm:@types/web@^0.0.358",
"rimraf": "^6.1.3",
"typescript": "7.0.2"
}
},
"private": true
}
10 changes: 0 additions & 10 deletions js/room/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@

/** Re-export of {@link https://jsr.io/@moq/clock | @moq/clock}, the time units this package's signatures take. */
export * as Clock from "@moq/clock";
/** Re-export of {@link https://jsr.io/@moq/hang | @moq/hang}, the media layer. */
export * as Hang from "@moq/hang";
/** Re-export of {@link https://jsr.io/@moq/net | @moq/net}, the transport. */
export * as Net from "@moq/net";
/** Re-export of `@moq/publish`, which publishes each participant's media. */
export * as Publish from "@moq/publish";
/** Re-export of {@link https://jsr.io/@moq/signals | @moq/signals}, the reactive primitives used throughout this package. */
export * as Signals from "@moq/signals";
/** Re-export of `@moq/watch`, which plays each participant's media. */
export * as Watch from "@moq/watch";

/** Chat messages exchanged in the room. */
export * as Chat from "./chat.ts";
Expand Down
1 change: 0 additions & 1 deletion quest/m1/api-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Rejected in planning:
- [MIGRATE matches release](/quest/m1/api-audit/migrate.md) - every break already on main has a correct entry measured against release, and entries for unreleased packages are gone
- [Two broadcast resolutions](/quest/m1/api-audit/resolve.md) - Rust, JS, and the bindings resolve a broadcast with `request(path, epoch)` or `follow(path, epoch)`, and every racy two-step caller is gone
- [The origin announces](/quest/m1/api-audit/announce-owner.md) - a broadcast producer cannot announce; the origin hands out the announcement, so `Prepared` and standalone broadcasts lose methods that always fail
- [Unpublish what nothing uses](/quest/m1/api-audit/unpublish.md) - packages, features, and listeners with no consumer stop shipping or stop being on by default
- [Container formats name inputs](/quest/m1/api-audit/container-format.md) - `ContainerFormat` names what is parsed, never how it is packaged; `ContainerStream` and TS passthrough internals are gone
- [moq-net exports with a consumer](/quest/m1/api-audit/net-exports.md) - the dead and test-only moq-net, `@moq/net`, and moq-ffi items the follow-up audit found go private or away
- [One clean close](/quest/m1/api-audit/clean-close.md) - a clean session close has one spelling and failures are recorded inside moq-net
Expand Down
38 changes: 0 additions & 38 deletions quest/m1/api-audit/unpublish.md

This file was deleted.

3 changes: 3 additions & 0 deletions quest/m2/e2ee/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Existing plaintext commands remain the default; an explicit application credenti

## Plan

Make `moq-e2ee` publishable with this CLI consumer; the crate currently sets
`publish = false` while it is workspace-only.

- Hand the [trait-generic CLI paths](/quest/m2/net-wrap/cli.md) an encrypted broadcast for publication and playback. Keep codec, capture, playback, and synchronization logic outside the crypto layer.
- Accept the credential through a dedicated file descriptor, otherwise-unused stdin, or a permission-checked file (`0600` on Unix), never a command argument or environment variable. Redact errors and tracing, zeroize owned secret bytes, and document shell-safe invocation.
- Follow the approved protected naming contract for mux, video, audio,
Expand Down
2 changes: 2 additions & 0 deletions quest/m2/p2p/udp-demux.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Binding request without USERNAME is a public query; drop and count it.
Decided 2026-10-08: the public STUN responder is left to the P2P line,
so `moq-sock` takes no STUN codec dependency (str0m included). Decided
2026-10-13: it binds its own port ([relay STUN](/doc/bin/relay/config.md#stun)).
That listener and its settings are behind the relay's non-default `stun`
feature; consuming it must enable that feature explicitly.

WebRTC: DTLS, RTP, and USERNAME-carrying STUN go to a `webrtc` hook that
`moq-relay` leaves unconsumed and an embedder takes: the datagrams, a send
Expand Down
4 changes: 4 additions & 0 deletions quest/m2/p2p/watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ the peer goes away, with no visible interruption.

## Plan

Publish `@moq/p2p` with its first application consumer in this quest. It is
currently private and has no release script; the `test/p2p` harness uses its
workspace source.

`moq-watch` and `moq-publish` gain a `p2p` attribute that constructs
`Peers` on the shared connection's origin and its relay auth handle (see
[Signaling and policy](/quest/m2/p2p/signal.md)), with the demo's ICE servers
Expand Down
3 changes: 3 additions & 0 deletions quest/m2/wire-stats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ the stats producer samples and preserves their final values. Native tokio
and io_uring QUIC sources and their relay integration tests are already on
`main`. Reuse that registry and accounting; do not create another one.

The unused public RTC wire source was removed. Reintroduce one only with an
adapter that registers it on the shared stats handle for a real consumer.

Remaining here: finish the qmux and SRT adapter children, then verify their
wire counters appear in the existing per-root presence and per-tier totals
alongside native sessions, with final counts retained when a source closes.
Expand Down
7 changes: 6 additions & 1 deletion rs/moq-boy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ version = "0.5.12"
edition = "2024"
rust-version.workspace = true

[[bin]]
name = "moq-boy"
path = "src/main.rs"
required-features = ["openh264"]

[features]
default = ["quic", "websocket"]
jemalloc = ["moq-tokio/jemalloc"]
# The software H.264 encoder. moq-boy needs it at runtime (a 160x144 frame is
# below every hardware encoder's minimum), but it is vendored C++, so it stays
# off for development builds and refused at startup when missing. Defaulting it
# off for development builds; the binary requires it at build time. Defaulting it
# on would turn it on for every workspace build through feature unification.
# The nix package turns it on.
openh264 = ["moq-video/openh264"]
Expand Down
2 changes: 1 addition & 1 deletion rs/moq-boy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ See the [demo](https://github.com/moq-dev/moq/tree/main/demo/boy) for the orches
cargo install moq-boy --features openh264
```

The `openh264` feature is required: a Game Boy frame is below every hardware encoder's minimum size, so moq-boy refuses to start without the software encoder.
The `openh264` feature is required: a Game Boy frame is below every hardware encoder's minimum size, so Cargo refuses to build or install the binary without the software encoder.
4 changes: 0 additions & 4 deletions rs/moq-boy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ async fn main() -> Result<()> {
let config = Config::parse();
config.log.init()?;
config.check_deprecated()?;
// A 160x144 frame is below every hardware encoder's minimum, so OpenH264 is the only one.
if !cfg!(feature = "openh264") {
anyhow::bail!("built without the `openh264` feature: cargo install moq-boy --features openh264");
}

#[cfg(feature = "jemalloc")]
let jemalloc = moq_tokio::jemalloc::run();
Expand Down
2 changes: 1 addition & 1 deletion rs/moq-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ path = "src/main.rs"
doc = false

[features]
default = ["cluster-lan", "quic", "websocket", "webrtc", "nvidia", "s3", "gcs", "azure"]
default = ["cluster-lan", "quic", "websocket", "nvidia", "s3", "gcs", "azure"]
# Experimental transport with a heavy dependency tree, enabled only on request.
iroh = ["moq-relay/iroh", "moq-tokio/iroh"]
# LAN discovery and meshing (`--cluster-lan`).
Expand Down
1 change: 1 addition & 0 deletions rs/moq-e2ee/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
publish = false
name = "moq-e2ee"
description = "End-to-end encryption for MoQ groups, datagrams, and track names."
authors = ["Luke Curley <kixelated@gmail.com>"]
Expand Down
8 changes: 2 additions & 6 deletions rs/moq-e2ee/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
[![Documentation](https://docs.rs/moq-e2ee/badge.svg)](https://docs.rs/moq-e2ee/)
[![Crates.io](https://img.shields.io/crates/v/moq-e2ee.svg)](https://crates.io/crates/moq-e2ee)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/moq-dev/moq/blob/main/LICENSE-MIT)

# moq-e2ee

Workspace-only implementation; this crate is not published.

End-to-end encryption for [Media over QUIC](https://moq.dev) groups, datagrams,
and track names. Profile `moq-e2ee-00` from
[draft-lcurley-moq-e2ee](https://datatracker.ietf.org/doc/draft-lcurley-moq-e2ee/).

Relays forward ciphertext. Content keys never enter `moq-net`.

```bash
cargo add moq-e2ee
```

## Shape

The application distributes a `Credential { context, kid, secret }` over its own
Expand Down
2 changes: 1 addition & 1 deletion rs/moq-ice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ str0m is sans-IO and requires every mutation to be followed by draining its
output. `Agent::rtc_mut` hands out a guard that drains when dropped, so callers
can't forget.

This is infrastructure, not an entry point: `moq-tokio`'s `webrtc` feature
This is internal infrastructure with no API stability promise: `moq-tokio`'s `webrtc` feature
builds MoQ data channels on it, and `moq-rtc` builds its WHIP/WHEP gateway.
Loading
Loading