Skip to content

Instantly share code, notes, and snippets.

@crtr0
Created December 3, 2012 20:58
Show Gist options
  • Save crtr0/4197975 to your computer and use it in GitHub Desktop.
Save crtr0/4197975 to your computer and use it in GitHub Desktop.
Initialize socket.io, attach it to our server and handle some events
socketio = require('socket.io')
// Attach socket.io to our web server
io = socketio.listen(server);
io.configure('development', function(){
io.set('log level', 1);
});
io.sockets.on('connection', function(socket) {
socket.on('event', function(event) {
socket.join(event);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment