lss-mqtt
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

lss-mqtt

Lightweight Security Scheme for MQTT

This project is proof of concept of work from

Lightweight Security Scheme for MQTT/MQTT-SN, 2019 Sixth International Conference on Internet of Things: Systems, Management and Security (IOTSMS)

Usage example (Typescript/ES6+)

 
import {LssMqtt} from 'lss-mqtt';
 
// Configuration
const lssMqttClient = new LssMqtt({ip: "<Your broker ip>", port: <your broker port>, key: "<your private key>"})
 
// Publishing
const myTopic = 'myTopic'
let counter = 0
setInterval(() => {
    lssMqttClient.api.publish(myTopic, `Counter: ${counter++}`);
}, 500);
 
 
// Subscribing
lssMqttClient.api.subscribe(myTopic)
lssMqttClient.callback = (topic, message) => {
    if (topic === myTopic) console.log(message);
}

/lss-mqtt/

    Package Sidebar

    Install

    npm i lss-mqtt

    Weekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    12.8 kB

    Total Files

    19

    Last publish

    Collaborators

    • pantalejmon