Interface DialWebRTCConf

Options required to dial a robot via WebRTC.

interface DialWebRTCConf {
    credentials?: Credential | AccessToken;
    dialTimeout?: number;
    dialTimeoutMs?: number;
    disableSessions?: boolean;
    extraHeaders?: Record<string, string>;
    forceP2P?: boolean;
    forceRelay?: boolean;
    host: string;
    iceServers?: ICEServer[];
    noReconnect?: boolean;
    priority?: number;
    reconnectAbortSignal?: { abort: boolean };
    reconnectMaxAttempts?: number;
    reconnectMaxWait?: number;
    serviceHost?: string;
    shouldRetryOnError?: () => boolean;
    signalingAddress: string;
    signalingInsecure?: boolean;
    turnPort?: number;
    turnScheme?: "turn" | "turns";
    turnTransport?: "tcp" | "udp";
    turnUri?: string;
}

Properties

credentials?: Credential | AccessToken
dialTimeout?: number

Set timeout in milliseconds for dialing. Default is defined by DIAL_TIMEOUT. A value of 0 disables the timeout.

Use dialTimeoutMs instead.

dialTimeoutMs?: number

Set timeout in milliseconds for dialing. Default is defined by DIAL_TIMEOUT. A value of 0 disables the timeout.

disableSessions?: boolean
extraHeaders?: Record<string, string>
forceP2P?: boolean

When true, strips TURN servers from the ICE configuration so only host and server-reflexive candidates are used. Useful for testing direct connectivity without relay fallback.

forceRelay?: boolean

When true, sets ICE transport policy to relay-only so only TURN candidates are used. Useful for testing relay connectivity through a TURN server.

host: string
iceServers?: ICEServer[]
noReconnect?: boolean
priority?: number
reconnectAbortSignal?: { abort: boolean }
reconnectMaxAttempts?: number
10.
reconnectMaxWait?: number
Number.POSITIVE_INFINITY
serviceHost?: string
shouldRetryOnError?: () => boolean

Called when a non-retryable error is encountered during reconnection. Return true to treat the error as retryable. Does not override reconnectMaxAttempts — retries are still bounded by that limit.

signalingAddress: string
signalingInsecure?: boolean

When true, the connection to the signaling server is made over plain HTTP (no TLS). Use this when connecting to a robot running with no_tls: true.

turnPort?: number

Overrides the port of the matched TURN URI.

turnScheme?: "turn" | "turns"

Overrides the scheme of the matched TURN URI ("turn" or "turns").

turnTransport?: "tcp" | "udp"

Overrides the transport of the matched TURN URI ("tcp" or "udp").

turnUri?: string

When set, filters the signaling server's TURN list to only the server whose parsed URI matches (compared by scheme, host, port, and transport — defaulting transport to UDP if unspecified). Example: "turn:turn.viam.com:443"