Server syntax:
var io = require('socket.io')(80);
io.on('connection', function (mysocket) {
//emit to all but the one who started it
mysocket.broadcast.emit('user connected');
//emit to all sockets
io.emit('my event', { messg: 'for all'});
});
// a javascript client would listen ...