edgeport - v1.0.3
    Preparing search index...

    Interface MqttConnectOptions

    Options for connect.

    1.0.0

    interface MqttConnectOptions {
        cleanSession?: boolean;
        clientId?: string;
        hostname: string;
        keepAliveSeconds?: number;
        password?: string;
        port?: number;
        scheduler?: MqttScheduler;
        timeoutMs?: number;
        tls?: "off" | "starttls" | "implicit";
        transport?: "ws" | "tcp";
        url?: string;
        username?: string;
        will?: {
            payload: string | Uint8Array<ArrayBufferLike>;
            qos?: 0 | 1 | 2;
            retain?: boolean;
            topic: string;
        };
    }
    Index
    cleanSession?: boolean

    Whether the broker should start a clean session (default true).

    clientId?: string

    Client identifier; a random one is generated when omitted.

    hostname: string

    Remote broker host (ignored when transport: 'ws'; use connectWebSocket).

    keepAliveSeconds?: number

    Keep-alive interval in seconds (default 60); 0 disables keep-alive PINGREQs.

    password?: string

    Password for credential auth.

    port?: number

    Remote port; defaults to 1883.

    scheduler?: MqttScheduler

    Optional timer override for the keep-alive loop (mainly for testing).

    timeoutMs?: number

    Read deadline in milliseconds for the connect handshake.

    tls?: "off" | "starttls" | "implicit"

    Transport security:

    • 'off': plaintext TCP.
    • 'implicit': TLS from the first byte (typically port 8883).
    • 'starttls': plaintext, upgraded to TLS before CONNECT.

    Defaults to 'off'.

    transport?: "ws" | "tcp"

    Transport to use; 'tcp' (default) or 'ws' for MQTT-over-WebSocket.

    url?: string

    WebSocket URL, required when transport: 'ws'.

    username?: string

    Username for credential auth.

    will?: {
        payload: string | Uint8Array<ArrayBufferLike>;
        qos?: 0 | 1 | 2;
        retain?: boolean;
        topic: string;
    }

    Last Will and Testament: the broker publishes this if the client drops without a clean DISCONNECT (e.g. close({ graceful: false })), enabling offline detection.