• Public
  • Public/Protected
  • All

Interface MqttClientOptions




Optional ca

ca: string | string[] | Buffer | Buffer[]

Optionally override the trusted CA certificates in PEM format

Optional cert

cert: string | string[] | Buffer | Buffer[]

optional cert chains in PEM format

Optional clean

clean: boolean

true, set to false to receive QoS 1 and 2 messages while offline

Optional clientId

clientId: string

'mqttjs_' + Math.random().toString(16).substr(2, 8)

Optional connectTimeout

connectTimeout: number

30 * 1000 milliseconds, time to wait before a CONNACK is received

Optional host

host: string

Optional hostname

hostname: string

Optional incomingStore

incomingStore: any

a any for the incoming packets

Optional keepalive

keepalive: number

10 seconds, set to 0 to disable

Optional key

key: string | string[] | Buffer | Buffer[] | Object[]

optional private keys in PEM format

Optional outgoingStore

outgoingStore: any

a any for the outgoing packets

Optional password

password: string

the password required by your broker, if any

Optional path

path: string

Optional port

port: number

Optional protocol

protocol: "wss" | "ws" | "mqtt" | "mqtts" | "tcp" | "ssl" | "wx" | "wxs"

Optional protocolId

protocolId: string


Optional protocolVersion

protocolVersion: number


Optional queueQoSZero

queueQoSZero: boolean

Optional reconnectPeriod

reconnectPeriod: number

1000 milliseconds, interval between two reconnections

Optional rejectUnauthorized

rejectUnauthorized: boolean

Optional reschedulePings

reschedulePings: boolean

Optional resubscribe

resubscribe: boolean

true, set to false to disable re-subscribe functionality

Optional servers

servers: Array<object>

Optional transformWsUrl

transformWsUrl: function

Type declaration

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

      • url: string
      • options: any
      • client: any

      Returns string

Optional username

username: string

the username required by your broker, if any

Optional will

will: object

a message that will sent by the broker automatically when the client disconnect badly.

Type declaration

  • payload: string

    the message to publish

  • qos: QoS

    the QoS

  • retain: boolean

    the retain flag

  • topic: string

    the topic to publish

Optional wsOptions

wsOptions: object

Type declaration

  • [x: string]: any

Generated using TypeDoc