Q:

socket.io not working on several clients

I'm trying to build a simple chat client and am having some issues getting it working across multiple clients. Chances are I've missed something really simple. When I send something from one client it is logged in that client but not in any others.
Server:
var io = require('socket.io').listen(5000);

io.sockets.on('connection', function (socket) {
    socket.on('send', function (data) {
        socket.emit('receive', data);
    });
});

Client:
var socket = io.connect('http://localhost:5000');
socket.on('receive', function(data){
    console.log("Data received at " + new Date() + ": " + data);
});

A:

The socket variable that gets passed to your callback function is a handle on the client that connected, so socket.emit is behaving correctly, i.e. it should only send to the client that originated it.
Try:
socket.broadcast.emit('receive', data);

to send to everybody except the originating client, or
io.sockets.emit('receive', data);

to send to all clients including the originator.

