pomelo mqtt connector -


MIT
跨平台
JavaScript

软件简介

pomelo mqtt connector (pomelo mqtt connector) 基于 MQTT,TCP 和 WS 协议。

使用

var MqttConnector = require('pomelo-mqtt-connector');

// in pomelo app.configure setup mqtt connector configuration
app.configure('all', 'connector', function() {
    app.set('connectorConfig', {
        connector: MqttConnector,
        publishRoute: 'connector.mqttHandler.publish',
        subscribeRoute: 'connector.mqttHandler.subscribe',
        encode: MqttConnector.encode
    });
});

选项

@param {Boolean} opts.distinctHost
@param {Boolean} opts.timeout
@param {Boolean} opts.setNoDelay
@param {Boolean} opts.disconnectOnTimeout
@param {String} opts.publishRoute
@param {String} opts.subscribeRoute
@param {String} opts.selfDefinedRoute