Skip to content

Instantly share code, notes, and snippets.

@JoaoPedroPP
Created September 12, 2020 01:33
Show Gist options
  • Save JoaoPedroPP/78cd55f4787e5963b5e87a7b00a7b0c1 to your computer and use it in GitHub Desktop.
Save JoaoPedroPP/78cd55f4787e5963b5e87a7b00a7b0c1 to your computer and use it in GitHub Desktop.
const mqtt = require('mqtt');
var client = mqtt.connect('mqtt://endereco', {port: port, username: 'username', password: 'password'})
client.on('connect', function () {
client.on('message', (t, b) => {
console.log(b.toString())
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment