To send something to all clients, you use:
io.sockets.emit(\'response\', data);
To receive from clients, you use:
socket.on
Other cases
io.of('/chat').on('connection', function (socket) { //sending to all clients in 'room' and you io.of('/chat').in('room').emit('message', "data"); };