1.1.1 • Published 3 years ago

egg-mqtt-plugin v1.1.1

Weekly downloads
5
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.1.1

3 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago