moqtail-ts
    Preparing search index...

    Type Alias MOQtailClientOptions

    Options for MOQtailClient.new controlling connection target, protocol negotiation, timeouts, and lifecycle callbacks.

    const opts: MOQtailClientOptions = {
    url: 'https://relay.example.com/moq',
    supportedVersions: [0xff00000b]
    }
    const client = await MOQtailClient.new(opts)
    const client = await MOQtailClient.new({
    url: relayUrl,
    supportedVersions: [0xff00000b],
    dataStreamTimeoutMs: 5000,
    controlStreamTimeoutMs: 1500,
    callbacks: {
    onMessageSent: m => logOutbound(m),
    onMessageReceived: m => logInbound(m),
    onSessionTerminated: r => console.warn('terminated', r)
    }
    })
    type MOQtailClientOptions = {
        callbacks?: {
            onMessageReceived?: (msg: ControlMessage) => void;
            onMessageSent?: (msg: ControlMessage) => void;
            onSessionTerminated?: (reason?: unknown) => void;
        };
        controlStreamTimeoutMs?: number;
        dataStreamTimeoutMs?: number;
        setupParameters?: SetupParameters;
        supportedVersions: number[];
        transportOptions?: WebTransportOptions;
        url: string
        | URL;
    }
    Index

    Properties

    callbacks?: {
        onMessageReceived?: (msg: ControlMessage) => void;
        onMessageSent?: (msg: ControlMessage) => void;
        onSessionTerminated?: (reason?: unknown) => void;
    }

    callbacks for observability and logging purposes:

    Type declaration

    • OptionalonMessageReceived?: (msg: ControlMessage) => void

      Called for each incoming control message before protocol handling.

    • OptionalonMessageSent?: (msg: ControlMessage) => void

      Called after a control message is successfully written to the ControlStream.

    • OptionalonSessionTerminated?: (reason?: unknown) => void

      Fired once when the session ends (normal or error). Receives the reason passed to disconnect.

    controlStreamTimeoutMs?: number

    Control stream read timeout in milliseconds.

    dataStreamTimeoutMs?: number

    Per data uni-stream idle timeout in milliseconds.

    setupParameters?: SetupParameters

    SetupParameters customizations; if omitted a default instance is built.

    supportedVersions: number[]

    Ordered preference list of MOQT protocol version numbers (e.g. 0xff00000b).

    transportOptions?: WebTransportOptions

    Passed directly to the browser's WebTransport constructor for WebTransportOptions.

    url: string | URL

    Relay / server endpoint for the underlying WebTransport session (can be absolute URL or string).