Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ConnectOptions

Hierarchy

  • IClientOptions
    • ConnectOptions

Index

Properties

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: undefined | false | true

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

Optional clientId

clientId: undefined | string

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

Optional connectTimeout

connectTimeout: undefined | number

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

fromId

fromId: string

Optional host

host: undefined | string

Optional hostname

hostname: undefined | string

Optional incomingStore

incomingStore: Store

a Store for the incoming packets

Optional keepalive

keepalive: undefined | 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: Store

a Store for the outgoing packets

Optional password

password: undefined | string

the password required by your broker, if any

Optional path

path: undefined | string

Optional port

port: undefined | number

Optional properties

properties: undefined | { authenticationData?: Buffer; authenticationMethod?: undefined | string; maximumPacketSize?: undefined | number; receiveMaximum?: undefined | number; requestProblemInformation?: undefined | false | true; requestResponseInformation?: undefined | false | true; sessionExpiryInterval?: undefined | number; topicAliasMaximum?: undefined | number; userProperties?: Object }

Optional protocol

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

Optional protocolId

protocolId: undefined | string

'MQTT'

Optional protocolVersion

protocolVersion: undefined | number

4

Optional publishEndpoint

publishEndpoint: undefined | string

Optional queueQoSZero

queueQoSZero: undefined | false | true

Optional reconnectPeriod

reconnectPeriod: undefined | number

1000 milliseconds, interval between two reconnections

Optional rejectUnauthorized

rejectUnauthorized: undefined | false | true

Optional reschedulePings

reschedulePings: undefined | false | true

Optional resubscribe

resubscribe: undefined | false | true

true, set to false to disable re-subscribe functionality

Optional servers

servers: Array<{ host: string; port: number; protocol?: "wss" | "ws" | "mqtt" | "mqtts" | "tcp" | "ssl" | "wx" | "wxs" }>

Optional subscribeEndpoint

subscribeEndpoint: undefined | string

toId

toId: string

Optional transformWsUrl

transformWsUrl: undefined | ((url: string, options: IClientOptions, client: MqttClient) => string)

Optional username

username: undefined | string

the username required by your broker, if any

Optional will

will: undefined | { payload: Buffer | string; properties?: undefined | { contentType?: undefined | string; correlationData?: Buffer; messageExpiryInterval?: undefined | number; payloadFormatIndicator?: undefined | false | true; responseTopic?: undefined | string; userProperties?: Object; willDelayInterval?: undefined | number }; qos: QoS; retain: boolean; topic: string }

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

Optional wsOptions

wsOptions: undefined | {}

Generated using TypeDoc