To send something to all clients, you use:
io.sockets.emit(\'response\', data);
To receive from clients, you use:
socket.on
use this coding
io.sockets.on('connection', function (socket) { socket.on('mousemove', function (data) { socket.broadcast.emit('moving', data); });
this socket.broadcast.emit() will emit everthing in the function except to the server which is emitting