Skip to content

Instantly share code, notes, and snippets.

@NathanGRomano
Last active August 29, 2015 14:02
Show Gist options
  • Save NathanGRomano/1e056977331630d3245f to your computer and use it in GitHub Desktop.
Save NathanGRomano/1e056977331630d3245f to your computer and use it in GitHub Desktop.
bus.io
/* Create a Simple Server with Bus.io and Socket.io-Client */
//on the server (be sure to have redis running locally!)
var bus = require('bus.io')(3000);
//on the client
var socket = require('socket.io-client')('http://localhost:30000');
socket.on('connect', function () {
socket.emit('shout', 'Hello, World!');
});
socket.on('shout', function (who, what) {
console.log(who + ' shouted ' + what + '!!!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment