Last active
August 29, 2015 14:04
-
-
Save ramajd/0f18daeaddefdec960b3 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 chid = '69432217-a8d6-4086-9d04-eea8d0ce4a55'; | |
var deviceId = 'testDevice'; | |
var devicePass = '2d70dd0e-1d57-4034-ac8a-3d01c76a9f45'; | |
var c1 = mqtt.createClient(1883, 'localhost', { | |
clientId : deviceId, | |
username : deviceId, | |
password : devicePass | |
}); | |
c1.on('connect', function(){ | |
console.log('c1 connected'); | |
}); | |
var c2 = mqtt.createClient(1883, 'localhost', { | |
clientId : deviceId, | |
username : deviceId, | |
password : devicePass | |
}); | |
c2.on('connect', function(){ | |
console.log('c2 connected'); | |
}) | |
c1.subscribe(chid); | |
c2.subscribe(chid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment