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: 1 addition & 1 deletion .oss-scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN rustup show active-toolchain || rustup toolchain install \
&& curl -LsSf "https://get.nexte.st/$NEXTEST_VERSION/$nextest" | tar zxf - -C "$CARGO_HOME/bin" \
&& cargo nextest --version

ARG CRATES="kio hang moq-auth moq-crypto moq-hls moq-json moq-loc moq-msf moq-mux moq-net moq-pattern moq-quic moq-relay moq-rtmp moq-rtsp moq-sock moq-srt moq-stats moq-tokio moq-uring moq-webrtc moq-cli"
ARG CRATES="kio hang moq-auth moq-crypto moq-e2ee moq-hls moq-json moq-loc moq-msf moq-mux moq-net moq-pattern moq-quic moq-relay moq-rtmp moq-rtsp moq-sock moq-srt moq-stats moq-tokio moq-uring moq-webrtc moq-cli"

# Path specs, because the lockfile also has published copies of some workspace crates.
RUN cargo fetch --locked \
Expand Down
4 changes: 2 additions & 2 deletions .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The relay is deployed on the public internet as shared infrastructure: one proce
- **Cache integrity.** The relay caches and forwards groups by broadcast, track, and group. A publisher must not be able to overwrite or inject into a broadcast it was not granted, and a subscriber must never receive one tenant's data under another tenant's name.
- **Cluster trust.** Peer relays authenticate with tokens or mTLS and get broader rights than clients. A relay dials only configured or discovered peers, never a URL learned from an announcement. LAN discovery over mDNS (`[cluster.lan]`) is open to anyone on the network unless `secret` is set, which is documented; with `secret` set, an unkeyed host must not be able to join.
- **Amplification and reflection.** QUIC's anti-amplification limit and address validation, and ICE in the WebRTC gateway, answer unauthenticated UDP. A response larger than the request toward a spoofed source is a finding.
- **End-to-end encryption.** `moq-crypto` encrypts groups, datagrams, and track names so a relay cannot read them. A flaw in the construction (nonce reuse, a key or name leaking to the relay, a forgeable group) is in scope.
- **End-to-end encryption.** `moq-e2ee`, unpublished and experimental, encrypts groups, datagrams, and track names so a relay cannot read them. A flaw in the construction (nonce reuse, a key or name leaking to the relay, a forgeable group) is in scope.

## Components that matter most / least

Expand All @@ -35,7 +35,7 @@ Most important, in this order:
2. Authorization: a session publishing, subscribing, or seeing announcements outside its grant, or reaching another root (tenant) through path tricks, revalidation, mounts, or cluster links.
3. `rs/moq-mux` and `rs/hang`: container, codec, and catalog parsing of publisher-controlled bytes.
4. The ingest gateways: `rs/moq-rtmp`, `rs/moq-rtsp`, `rs/moq-srt`, `rs/moq-webrtc`, `rs/moq-hls`.
5. `rs/moq-crypto`, `rs/moq-cli`, `rs/moq-json`, `rs/moq-stats`, `rs/kio`.
5. `rs/moq-crypto`, `rs/moq-e2ee`, `rs/moq-cli`, `rs/moq-json`, `rs/moq-stats`, `rs/kio`.

`unsafe` is rare and worth reading closely where it appears: `rs/moq-quic`, `rs/moq-net/src/model`, `rs/moq-net/src/util/cell.rs`, `rs/moq-net/src/transport.rs`, and `rs/moq-relay/src/uring.rs`.

Expand Down
24 changes: 19 additions & 5 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ default-members = [
"rs/moq-bench",
"rs/moq-cli",
"rs/moq-crypto",
"rs/moq-e2ee",
# "rs/moq-ffi", # requires Python/maturin
# "rs/moq-gst", # requires GStreamer
"rs/moq-hls",
Expand Down
8 changes: 4 additions & 4 deletions bun.lock

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

24 changes: 2 additions & 22 deletions doc/concept/hang.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ hang is the media format on top of [moq-lite](/concept/moq-lite): a catalog
track that describes the media tracks, and a container that gives each frame a
timestamp. It is modeled on [WebCodecs](https://www.w3.org/TR/webcodecs/) so a
browser can decode it directly. The spec is
[draft-lcurley-moq-hang](/draft/moq-hang). Plaintext broadcast names end in
`.hang` so a player knows which catalog to expect. End-to-end encrypted
broadcasts live at `<opaque>`, derived from the credential and a semantic name
such as `foo.hang`, and the [instance](/concept/moq-lite#publisher-instances)
on their route, the run's moq-e2ee epoch, identifies each publisher run. The path exposes no format or protection marker; the
payloads follow [moq-e2ee](/draft/moq-e2ee). See [Encryption](#encryption).
[draft-lcurley-moq-hang](/draft/moq-hang). Broadcast names end in
`.hang` so a player knows which catalog to expect.

## Catalog

Expand Down Expand Up @@ -224,22 +220,6 @@ exception: its samples are always length-prefixed, so an `avc3`/`hev1` CMAF
track keeps the configuration record as its `description` for the NAL length
size, even when the parameter sets ride in the samples.

## Encryption

[moq-e2ee](/draft/moq-e2ee) encrypts groups, datagrams, and track names so a
relay forwards ciphertext and never sees a content key. The application
distributes the credential on its own channel. Each publisher run binds that
credential to a fresh moq-e2ee epoch, announced as its route's
[instance](/concept/moq-lite#publisher-instances), which derives the track names
and keys for that run alone. A restart under a fresh epoch
shares no names or keys with the previous run. Never share or reuse an epoch
under one credential, whether for a replica or a later run: two instances on
one epoch derive the same keys from the same group sequences and repeat
AES-GCM nonces. The broadcast path is an opaque name
derived from the credential and a semantic name such as `foo.hang`; it carries
no format marker. `moq-crypto` is the Rust implementation. Relays need no
configuration to carry it.

## Your own format

hang is a convention, not a requirement. If you control both ends, publish
Expand Down
3 changes: 1 addition & 2 deletions doc/concept/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ watched at 100 ms by one viewer and 10 s by another.
- [moq-lite](/concept/moq-lite): the pub/sub protocol, discovery, path patterns, subscriptions, and congestion behavior.
- [Identity and recovery](/concept/identity): choosing stream instances, following restarts, and answering work on demand without mixing streams.
- [Sockets](/concept/socket): dial and accept point-to-point sessions through relays, each a track of messages each way.
- [hang](/concept/hang): the media catalog, containers, encryption, and how to extend both.
- [hang](/concept/hang): the media catalog, containers, and how to extend both.
- [Archives](/concept/archives): record listed tracks into object storage and serve them back from a host.
- [Audio jitter](/concept/audio-jitter): how a receiver sizes its audio playout target from arrival timing.
- [Compressed tracks](/concept/compression): when to compress a track, what each protocol version receives, and the relay's cost.
Expand All @@ -53,7 +53,6 @@ watched at 100 ms by one viewer and 10 s by another.
| --- | --- |
| Who may publish or subscribe? | [Relay authentication](/bin/relay/auth) |
| How do I add chat, state, or custom tracks? | [JSON tracks](/lib/js/json), [rooms](/lib/js/room), or [raw pub/sub](/lib/rs/moq-net) |
| How does media encryption fit in? | [hang](/concept/hang) and the [E2EE draft](/draft/moq-e2ee) |
| How do multiple relays or redundant sources fit together? | [Clustering](/bin/relay/cluster) and [redundant ingest](/setup/redundancy) |
| How do restarts and failover keep content apart? | [Identity and recovery](/concept/identity) |
| Which package implements this layer? | [Libraries](/lib/) to integrate it, [repository map](/setup/repository) to change it |
Expand Down
4 changes: 2 additions & 2 deletions doc/concept/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ always, on moq-lite-07. It costs a moq-lite track nothing: only a track a moq-tr
publisher made carries the state, so the groups of any other cross the hop byte for
byte as they would without the extension.
[moq-e2ee](/draft/moq-e2ee), published and experimental, is not a transport extension. It encrypts
application payloads, so relays still forward named tracks they cannot read.
See [Encryption](/concept/hang#encryption).
application payloads, so relays still forward named tracks they cannot read. Its
implementation is unpublished while the format changes.

### Deliberate deviations

Expand Down
2 changes: 1 addition & 1 deletion doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ features:
- icon:
src: /emoji/lock.svg
title: Secure
details: Encrypted via TLS and authenticated via JWT. You can optionally self-host a private CDN or end-to-end encrypt your content.
details: Encrypted via TLS and authenticated via JWT. You can optionally self-host a private CDN.

- icon:
src: /emoji/back.svg
Expand Down
1 change: 0 additions & 1 deletion doc/lib/js/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ small examples. The [API reference](/lib/js/api/) covers every package; source l
| [@moq/json](/lib/js/json) | JSON over tracks: snapshots with merge-patch deltas, or append logs. |
| [@moq/stats](/lib/js/api/stats) | Read a relay's published traffic stats: discover nodes and yield typed frames. |
| [@moq/obs](/lib/js/api/obs) | Set up the OBS on the user's machine from a web page: a MoQ or RTMP(S) destination, live stats, and MoQ Sources. |
| [@moq/crypto](https://github.com/moq-dev/moq/tree/main/js/crypto) | Experimental end-to-end encryption of groups, datagrams, and track names, scoped to a publisher run's epoch, so relays forward content they cannot read. Workspace-only until the browser components use it. |
| [@moq/loc](/lib/js/api/loc), [@moq/msf](/lib/js/api/msf) | The IETF LOC container and MSF catalog. |

## Web components
Expand Down
1 change: 0 additions & 1 deletion doc/lib/rs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ missing required CPU feature before starting transport cryptography.
| [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-json](/lib/rs/moq-json) | JSON over tracks: snapshots with merge-patch deltas, or append logs. |
| [moq-crypto](https://github.com/moq-dev/moq/tree/main/rs/moq-crypto) | Experimental end-to-end encryption of groups, datagrams, and track names, scoped to a publisher run's epoch, so relays forward content they cannot read; the [e2ee draft](/draft/moq-e2ee) it implements is published. |
| [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. |
| [kio](/lib/rs/kio) | The async primitives everything polls through, and one clock for time and timers on tokio and a deterministic test simulator. |
Expand Down
2 changes: 1 addition & 1 deletion doc/setup/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ wrap the Rust core. [Layers](/lib/layers) maps the binding namespaces.
| CLI commands and protocol gateways | [`rs/moq-cli`](https://github.com/moq-dev/moq/tree/main/rs/moq-cli), then the corresponding `rs/moq-{rtmp,srt,webrtc,rtsp,hls}` crate | [Applications](/bin/) |
| Language bindings | [`rs/moq-ffi`](https://github.com/moq-dev/moq/tree/main/rs/moq-ffi), [`rs/moq-c`](https://github.com/moq-dev/moq/tree/main/rs/moq-c), then `py/`, `swift/`, `kt/`, `go/`, `dart/`, or `cpp/moq/` | [Binding layers](/lib/layers) |
| Rooms, chat, and application data | [`js/room`](https://github.com/moq-dev/moq/tree/main/js/room), `rs/moq-json`, `js/json` | [Rooms](/lib/js/room), [JSON tracks](/lib/js/json) |
| End-to-end encryption | [`rs/moq-crypto`](https://github.com/moq-dev/moq/tree/main/rs/moq-crypto), [`js/crypto`](https://github.com/moq-dev/moq/tree/main/js/crypto) | [Media encryption](/concept/hang), [E2EE draft](/draft/moq-e2ee) |
| End-to-end encryption (unpublished, experimental) | [`rs/moq-e2ee`](https://github.com/moq-dev/moq/tree/main/rs/moq-e2ee), [`js/e2ee`](https://github.com/moq-dev/moq/tree/main/js/e2ee) | [E2EE draft](/draft/moq-e2ee) |
| Async primitives and deterministic time | [`rs/kio`](https://github.com/moq-dev/moq/tree/main/rs/kio), [`js/clock`](https://github.com/moq-dev/moq/tree/main/js/clock) | [Rust conventions](/lib/rs/#conventions), [clock](/lib/js/clock) |

## Find the surrounding work
Expand Down
2 changes: 1 addition & 1 deletion doc/setup/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ replaces it.

- **Binaries:** [moq-relay](https://github.com/moq-dev/moq/blob/main/rs/moq-relay/MIGRATE.md), [moq-cli (`moq`)](https://github.com/moq-dev/moq/blob/main/rs/moq-cli/MIGRATE.md), [moq-gst](https://github.com/moq-dev/moq/blob/main/rs/moq-gst/MIGRATE.md), [obs-moq](https://github.com/moq-dev/moq/blob/main/cpp/obs/MIGRATE.md)
- **Bindings:** [moq-ffi (UniFFI)](https://github.com/moq-dev/moq/blob/main/rs/moq-ffi/MIGRATE.md), [moq-c (C)](https://github.com/moq-dev/moq/blob/main/rs/moq-c/MIGRATE.md), [Python](https://github.com/moq-dev/moq/blob/main/py/moq-rs/MIGRATE.md), [Go](https://github.com/moq-dev/moq/blob/main/go/wrapper/MIGRATE.md), [Swift](https://github.com/moq-dev/moq/blob/main/swift/MIGRATE.md), [Kotlin](https://github.com/moq-dev/moq/blob/main/kt/moq/MIGRATE.md), [Dart](https://github.com/moq-dev/moq/blob/main/dart/moq/MIGRATE.md), [C++](https://github.com/moq-dev/moq/blob/main/cpp/moq/MIGRATE.md)
- **Rust:** [hang](https://github.com/moq-dev/moq/blob/main/rs/hang/MIGRATE.md), [kio](https://github.com/moq-dev/moq/blob/main/rs/kio/MIGRATE.md), [kio-macros](https://github.com/moq-dev/moq/blob/main/rs/kio/macros/MIGRATE.md), [moq-archive](https://github.com/moq-dev/moq/blob/main/rs/moq-archive/MIGRATE.md), [moq-audio](https://github.com/moq-dev/moq/blob/main/rs/moq-audio/MIGRATE.md), [moq-auth](https://github.com/moq-dev/moq/blob/main/rs/moq-auth/MIGRATE.md), [moq-crypto](https://github.com/moq-dev/moq/blob/main/rs/moq-crypto/MIGRATE.md), [moq-hls](https://github.com/moq-dev/moq/blob/main/rs/moq-hls/MIGRATE.md), [moq-json](https://github.com/moq-dev/moq/blob/main/rs/moq-json/MIGRATE.md), [moq-loc](https://github.com/moq-dev/moq/blob/main/rs/moq-loc/MIGRATE.md), [moq-msf](https://github.com/moq-dev/moq/blob/main/rs/moq-msf/MIGRATE.md), [moq-mux](https://github.com/moq-dev/moq/blob/main/rs/moq-mux/MIGRATE.md), [moq-net](https://github.com/moq-dev/moq/blob/main/rs/moq-net/MIGRATE.md), [moq-nvenc](https://github.com/moq-dev/moq/blob/main/rs/moq-nvenc/MIGRATE.md), [moq-pattern](https://github.com/moq-dev/moq/blob/main/rs/moq-pattern/MIGRATE.md), [moq-rtmp](https://github.com/moq-dev/moq/blob/main/rs/moq-rtmp/MIGRATE.md), [moq-sock](https://github.com/moq-dev/moq/blob/main/rs/moq-sock/MIGRATE.md), [moq-srt](https://github.com/moq-dev/moq/blob/main/rs/moq-srt/MIGRATE.md), [moq-stats](https://github.com/moq-dev/moq/blob/main/rs/moq-stats/MIGRATE.md), [moq-tokio](https://github.com/moq-dev/moq/blob/main/rs/moq-tokio/MIGRATE.md), [moq-transcode](https://github.com/moq-dev/moq/blob/main/rs/moq-transcode/MIGRATE.md), [moq-uring](https://github.com/moq-dev/moq/blob/main/rs/moq-uring/MIGRATE.md), [moq-v4l](https://github.com/moq-dev/moq/blob/main/rs/moq-v4l/MIGRATE.md), [moq-video](https://github.com/moq-dev/moq/blob/main/rs/moq-video/MIGRATE.md), [moq-webrtc (was moq-rtc)](https://github.com/moq-dev/moq/blob/main/rs/moq-webrtc/MIGRATE.md), [qmux](https://github.com/moq-dev/moq/blob/main/rs/qmux/MIGRATE.md)
- **Rust:** [hang](https://github.com/moq-dev/moq/blob/main/rs/hang/MIGRATE.md), [kio](https://github.com/moq-dev/moq/blob/main/rs/kio/MIGRATE.md), [kio-macros](https://github.com/moq-dev/moq/blob/main/rs/kio/macros/MIGRATE.md), [moq-archive](https://github.com/moq-dev/moq/blob/main/rs/moq-archive/MIGRATE.md), [moq-audio](https://github.com/moq-dev/moq/blob/main/rs/moq-audio/MIGRATE.md), [moq-auth](https://github.com/moq-dev/moq/blob/main/rs/moq-auth/MIGRATE.md), [moq-hls](https://github.com/moq-dev/moq/blob/main/rs/moq-hls/MIGRATE.md), [moq-json](https://github.com/moq-dev/moq/blob/main/rs/moq-json/MIGRATE.md), [moq-loc](https://github.com/moq-dev/moq/blob/main/rs/moq-loc/MIGRATE.md), [moq-msf](https://github.com/moq-dev/moq/blob/main/rs/moq-msf/MIGRATE.md), [moq-mux](https://github.com/moq-dev/moq/blob/main/rs/moq-mux/MIGRATE.md), [moq-net](https://github.com/moq-dev/moq/blob/main/rs/moq-net/MIGRATE.md), [moq-nvenc](https://github.com/moq-dev/moq/blob/main/rs/moq-nvenc/MIGRATE.md), [moq-pattern](https://github.com/moq-dev/moq/blob/main/rs/moq-pattern/MIGRATE.md), [moq-rtmp](https://github.com/moq-dev/moq/blob/main/rs/moq-rtmp/MIGRATE.md), [moq-sock](https://github.com/moq-dev/moq/blob/main/rs/moq-sock/MIGRATE.md), [moq-srt](https://github.com/moq-dev/moq/blob/main/rs/moq-srt/MIGRATE.md), [moq-stats](https://github.com/moq-dev/moq/blob/main/rs/moq-stats/MIGRATE.md), [moq-tokio](https://github.com/moq-dev/moq/blob/main/rs/moq-tokio/MIGRATE.md), [moq-transcode](https://github.com/moq-dev/moq/blob/main/rs/moq-transcode/MIGRATE.md), [moq-uring](https://github.com/moq-dev/moq/blob/main/rs/moq-uring/MIGRATE.md), [moq-v4l](https://github.com/moq-dev/moq/blob/main/rs/moq-v4l/MIGRATE.md), [moq-video](https://github.com/moq-dev/moq/blob/main/rs/moq-video/MIGRATE.md), [moq-webrtc (was moq-rtc)](https://github.com/moq-dev/moq/blob/main/rs/moq-webrtc/MIGRATE.md), [qmux](https://github.com/moq-dev/moq/blob/main/rs/qmux/MIGRATE.md)
- **JavaScript:** [`@moq/auth`](https://github.com/moq-dev/moq/blob/main/js/auth/MIGRATE.md), [`@moq/clock`](https://github.com/moq-dev/moq/blob/main/js/clock/MIGRATE.md), [`@moq/hang`](https://github.com/moq-dev/moq/blob/main/js/hang/MIGRATE.md), [`@moq/json`](https://github.com/moq-dev/moq/blob/main/js/json/MIGRATE.md), [`@moq/loc`](https://github.com/moq-dev/moq/blob/main/js/loc/MIGRATE.md), [`@moq/msf`](https://github.com/moq-dev/moq/blob/main/js/msf/MIGRATE.md), [`@moq/net`](https://github.com/moq-dev/moq/blob/main/js/net/MIGRATE.md), [`@moq/pattern`](https://github.com/moq-dev/moq/blob/main/js/pattern/MIGRATE.md), [`@moq/publish`](https://github.com/moq-dev/moq/blob/main/js/publish/MIGRATE.md), [`@moq/qmux`](https://github.com/moq-dev/moq/blob/main/js/qmux/MIGRATE.md), [`@moq/room`](https://github.com/moq-dev/moq/blob/main/js/room/MIGRATE.md), [`@moq/signals`](https://github.com/moq-dev/moq/blob/main/js/signals/MIGRATE.md), [`@moq/video`](https://github.com/moq-dev/moq/blob/main/js/video/MIGRATE.md), [`@moq/watch`](https://github.com/moq-dev/moq/blob/main/js/watch/MIGRATE.md)

## Unreleased
Expand Down
Loading