react-native-mqtt-server
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

react-native-mqtt-server

MQTT server on React Native

Installation

npm install react-native-mqtt-server

Usage

import { Server, SimpleMQBroker } from 'react-native-mqtt-server';

// Use simple broker
const broker = new SimpleMQBroker();
broker.start();
broker.on('connect', id => console.log('Client connected', id));
broker.on('message', (topic, payload) => console.log('Message received', topic, payload));

// Use as MQTT server directly
const server = new Server();
server.on('connection', client => {
  client.on('data', packet => {
    console.log('Packet received', packet);
  });
});
server.listen(1883);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library


Built and maintained by BRICKS.

Package Sidebar

Install

npm i react-native-mqtt-server

Weekly Downloads

67

Version

0.4.1

License

MIT

Unpacked Size

90.1 kB

Total Files

17

Last publish

Collaborators

  • hans00