Namespace Discovery
Overview
Section titled “Overview”Namespace discovery lets you find out what tracks a relay has available. The mechanism varies by draft version:
- Drafts 07–12:
SUBSCRIBE_ANNOUNCES; matching namespaces arrive asANNOUNCEmessages - Draft-13:
SUBSCRIBE_NAMESPACE; matching namespaces arrive asANNOUNCEmessages - Drafts 14–15:
SUBSCRIBE_NAMESPACE; matching namespaces arrive asPUBLISH_NAMESPACEmessages - Drafts 16–23:
SUBSCRIBE_NAMESPACEon its own stream; matching namespaces arrive asNAMESPACEmessages and are withdrawn withNAMESPACE_DONE. In drafts 18–23,SUBSCRIBE_TRACKSsubscribes to the tracks in matching namespaces.
In drafts 07–22 a session cannot hold two namespace subscriptions whose prefixes overlap; in draft-23 it can. See SUBSCRIBE_NAMESPACE and prefix matching for the details.
Using the CLI
Section titled “Using the CLI”The fastest way to discover namespaces is moqtap peek:
# Discover all published namespacesmoqtap peek moqt://relay.example.com namespaces
# List tracks in a specific namespacemoqtap peek moqt://relay.example.com tracks live
# JSON outputmoqtap peek moqt://relay.example.com namespaces -jThe peek command auto-detects the relay’s draft version and uses the appropriate discovery mechanism.
Using the browser extension
Section titled “Using the browser extension”The browser extension passively decodes namespace discovery messages from your application’s WebTransport connections. Open the DevTools panel to see SUBSCRIBE_NAMESPACE, NAMESPACE and PUBLISH_NAMESPACE messages with full field display.
Stopping discovery
Section titled “Stopping discovery”In drafts 16–23, close the SUBSCRIBE_NAMESPACE stream to stop receiving namespace announcements. In drafts 13–15, send UNSUBSCRIBE_NAMESPACE; in drafts 07–12, UNSUBSCRIBE_ANNOUNCES.