1 var app = require('http').createServer(handler)
2 , io = require('socket.io').listen(app)
7 function handler (req, res) {
8 fs.readFile(__dirname + '/index.html',
12 return res.end('Error loading index.html');
20 io.sockets.on('connection', function (socket) {
21 setInterval(function() { socket.emit('news', { hello: 'world' });}, 2000);
22 socket.on('my other event', function (data) {
25 socket.on('jason', function (data) {
26 console.log({jason_is_here: data});