Interface MQTTClientOptions

Hierarchy

  • IClientOptions
    • MQTTClientOptions

Properties

ALPNProtocols?: Buffer | string[] | Uint8Array | Buffer[] | Uint8Array[]
auth?: string
authPacket?: Partial<IAuthPacket>
autoAssignTopicAlias?: boolean
autoUseTopicAlias?: boolean
binary?: boolean
browserBufferSize?: number
browserBufferTimeout?: number
ca?: string | Buffer | string[] | Buffer[]
caPaths?: string | string[]
cert?: string | Buffer | string[] | Buffer[]
certPath?: string
clean?: boolean
clientId?: string
connectTimeout?: number
customHandleAcks?: AckHandler
defaultProtocol?: MqttProtocol
encoding?: BufferEncoding
host?: string
hostname?: string
incomingStore?: IStore
keepalive?: number
key?: string | any[] | Buffer | string[] | Buffer[]
keyPath?: string
log?: ((...args) => void)

Type declaration

    • (...args): void
    • Parameters

      • Rest ...args: any[]
        Rest

      Returns void

manualConnect?: boolean
messageIdProvider?: IMessageIdProvider
my?: any
objectMode?: boolean
outgoingStore?: IStore
password?: string | Buffer
path?: string
port?: number
prefix?: string

Topic prefix

properties?: {
    authenticationData?: Buffer;
    authenticationMethod?: string;
    maximumPacketSize?: number;
    receiveMaximum?: number;
    requestProblemInformation?: boolean;
    requestResponseInformation?: boolean;
    sessionExpiryInterval?: number;
    topicAliasMaximum?: number;
    userProperties?: UserProperties;
}

Type declaration

  • Optional authenticationData?: Buffer
  • Optional authenticationMethod?: string
  • Optional maximumPacketSize?: number
  • Optional receiveMaximum?: number
  • Optional requestProblemInformation?: boolean
  • Optional requestResponseInformation?: boolean
  • Optional sessionExpiryInterval?: number
  • Optional topicAliasMaximum?: number
  • Optional userProperties?: UserProperties
protocol?: MqttProtocol
protocolId?: "MQTT" | "MQIsdp"
protocolVersion?: 4 | 5 | 3
qos?: QoS

Quality of Service for published messages

query?: Record<string, string>
queueQoSZero?: boolean
reconnectPeriod?: number
rejectUnauthorized?: boolean
reschedulePings?: boolean
resubscribe?: boolean
servername?: string
servers?: {
    host: string;
    port: number;
    protocol?: "wss" | "ws" | "mqtt" | "mqtts" | "tcp" | "ssl" | "wx" | "wxs";
}[]

Type declaration

  • host: string
  • port: number
  • Optional protocol?: "wss" | "ws" | "mqtt" | "mqtts" | "tcp" | "ssl" | "wx" | "wxs"
transformWsUrl?: ((url, options, client) => string)

Type declaration

    • (url, options, client): string
    • Parameters

      • url: string
      • options: IClientOptions
      • client: default

      Returns string

url: string
username?: string
will?: {
    payload: Buffer;
    properties?: {
        contentType?: string;
        correlationData?: Buffer;
        messageExpiryInterval?: number;
        payloadFormatIndicator?: boolean;
        responseTopic?: string;
        userProperties?: UserProperties;
        willDelayInterval?: number;
    };
    qos?: QoS;
    retain?: boolean;
    topic: string;
}

Type declaration

  • payload: Buffer
  • Optional properties?: {
        contentType?: string;
        correlationData?: Buffer;
        messageExpiryInterval?: number;
        payloadFormatIndicator?: boolean;
        responseTopic?: string;
        userProperties?: UserProperties;
        willDelayInterval?: number;
    }
    • Optional contentType?: string
    • Optional correlationData?: Buffer
    • Optional messageExpiryInterval?: number
    • Optional payloadFormatIndicator?: boolean
    • Optional responseTopic?: string
    • Optional userProperties?: UserProperties
    • Optional willDelayInterval?: number
  • Optional qos?: QoS
  • Optional retain?: boolean
  • topic: string
writeCache?: boolean
wsOptions?: any