1.6.0 • Published 3 years ago

egg-htmqtt v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

egg-mqtt-plugin

NPM version build status Test coverage David deps Known Vulnerabilities npm download

更详细的使用请阅读中文文档

Install

$ npm i egg-mqtt-plugin --save

Usage

// {app_root}/config/plugin.js
exports.mqtt = {
  enable: true,
  package: 'egg-mqtt-plugin',
};

Configuration

// {app_root}/config/config.default.js
exports.mqtt = {
  host: 'mqtt://xxx.xxx.x.x',
  port: 1883,
  username: 'username',
  password: 'password',
  clientId: 'client_id',
  options: {
    keeplive: 60,
    protocolId: 'MQTT',
    protocol: 'MQTT',
    protocolVersion: 4,
    clean: true,
    rejectUnauthorized: false,
    reconnectPeriod: 1000,
    connectTimeout: 30 * 1000,
  },
  topics: {
    'topic-topic-topic': { qos: 0 },
  },
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago