Created
June 21, 2017 11:56
-
-
Save CJ-Davies/b4d34bbf4bc3170ba06f5d49ffc6c9ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mqtt = require('mqtt'); | |
var client = mqtt.connect('mqtt://192.168.1.235:1883/',{ | |
protocolId: 'MQIsdp', | |
protocolVersion: 3, | |
username: 'user', | |
password: 'pass' | |
}); | |
client.subscribe('foo', function() { | |
console.log('subscribed'); | |
}); | |
client.publish('foo', 'bar', function() { | |
console.log('published'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment