Created
December 3, 2012 20:58
-
-
Save crtr0/4197975 to your computer and use it in GitHub Desktop.
Initialize socket.io, attach it to our server and handle some events
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
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