7 changed files with 82 additions and 48 deletions
@ -0,0 +1,22 @@ |
|||
'use strict'; |
|||
const mqtt = require('mqtt'); |
|||
|
|||
module.exports = async function factory (app, opts) { |
|||
// const client = mqtt.connect(opts.mqtt.mqttVideoServer);
|
|||
|
|||
// client.on('connect', function () {
|
|||
// console.info(`mqtt connect success ${opts.mqtt.mqttVideoServer}`);
|
|||
// })
|
|||
// client.on('error', function (e) {
|
|||
// console.error(`mqtt connect failed ${opts.mqtt.mqttVideoServer}`);
|
|||
// app.fs.logger.error('info', '[FS-AUTH-MQTT]', `mqtt connect failed ${opts.mqtt.mqttVideoServer}`);
|
|||
// })
|
|||
|
|||
// client.subscribe('test', { qos: 2 });//订阅主题为test的消息
|
|||
|
|||
// client.on('message', function (top, message) {
|
|||
// console.log(message.toString());
|
|||
// });
|
|||
|
|||
// app.mqttVideoServer = client
|
|||
} |
Loading…
Reference in new issue