Last active
August 29, 2015 14:02
-
-
Save NathanGRomano/1e056977331630d3245f to your computer and use it in GitHub Desktop.
bus.io
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
/* 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