by Guillermo Rauch is a revolutionary Node module that implements WebSockets in an intuitive JavaScript both on the Server and the client. The documentation is concise and clear.

To begin require and initialize on the server ...

var server = require('http').Server(app);
var io = require('')(server);

... and link to the library on the client:

<script src=""></script>

Then begin a connection on the server:

io.on('connection', function (socket) {
    // place socket code here.

and initialize the socket variable on the client:

var socket = io.connect('/');

Finally start passing messages around (making sure they share the same string identification).

On either the server or the client this code will send an object to all connected users:

socket.emit('some string', {toAll: 'is this fun or what?'});

And this will periodically receive emited information (placing it in either the client or the server)

socket.on('some string', function(data) {

From the server, you can send information to all users except the one who just sent it using:

socket.broadcast.emit('some string', {moreInfo: 'Oh yea'});


Create a Node server that receives information from each user and broadcasts that information to the other users.


You might be inspired by James Surowiecki's talk on the Wisdom of Crowds.