You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
742 B
23 lines
742 B
3 years ago
|
'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
|
||
|
}
|