This facility implements a promise based mqtt client and a simple mqtt broker.
This uses config file and it can only have one param port
which can be used to configure the port of the aedes broker. When initializing the facility, you can pass _hasConf: false
in opts to disable the config file.
Initiates a mqtt client instance for specific server.
Params:
opts.url<string>
- MQTT broker urlopts.libOpts<object>
- options for the underlyingmqttjs
library
Result:
MQTTClient
Example:
const mqtt = fac.getClient({
url: 'mqtt://127.0.0.1:7070'
})
Starts a mqtt broker powered by aedes. The broker will be started on the port specified in config file.