Skip to content

Instantly share code, notes, and snippets.

@pisatoshi
Created March 4, 2014 16:33
Show Gist options
  • Save pisatoshi/9349943 to your computer and use it in GitHub Desktop.
Save pisatoshi/9349943 to your computer and use it in GitHub Desktop.
MQTT subscribe example
var mqtt = require('mqtt');
var client = mqtt.createClient(61613, { username: 'admin', password: 'password' });
client.subscribe('test1/#');
client.on('message', function() {
console.log(arguments);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment