Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createServer(opts) {
opts = _.defaults(opts || {}, {
port: DEFAULT_PORT,
host: DEFAULT_HOST
});
let broker = new mqtt.Server(handler);
debug(': Instantiated local broker w/ opts:', opts);
broker.listen(opts.port, opts.host, function () {
let address = this.address();
debug(': Local broker listening on %s:%s', address.address,
address.port);
});
return broker;
}