io.sockets.on('connection', function (socket) { socket.on('ping', function() { socket.emit('pong'); }); });