Skip to main content

Module moq_frame

Module moq_frame 

Source
Expand description

Pure framing + reach-config parsing for the browser moq subscriber.

These are the transport-independent, side-effect-free pieces of the moq worker (moq_worker.rs, wasm-only). They live here — NOT gated on target_arch = "wasm32" — so they can be unit-tested on the host. The wasm worker re-uses them; the moq subscribe/WebTransport integration itself is exercised by the downstream browser e2e.

Structs§

ReachConfig
Network-routable reach the frontend selects (via selectReach) and passes to the worker as JSON. The moq broadcast path (which track to subscribe) is NOT here — it arrives later in a subscribe command, since one worker can serve several subscriptions on the same endpoint.

Functions§

decode_frame
Decode one DMA frame. Returns (track_name, payload), or None if the buffer is malformed (too short, length prefix past the end, or a non-UTF-8 track name).
encode_frame
Encode one DMA frame.
parse_reach
Parse the reach JSON the frontend emits into a ReachConfig, base64-decoding the cert hashes.