4 min. read is a realtime JavaScript Library

Introduction to



// sending to sender-client only
socket.emit(‘message’, “this is a test”);

// sending to all clients, include sender
io.emit(‘message’, “this is a test”);

// sending to all clients except sender
socket.broadcast.emit(‘message’, “this is a test”);

// sending to all clients in ‘game’ room(channel) except sender‘game’).emit(‘message’, ‘nice game’);

// sending to all clients in ‘game’ room(channel), include sender‘game’).emit(‘message’, ‘cool game’);

// sending to sender client, only if they are in ‘game’ room(channel)‘game’).emit(‘message’, ‘enjoy the game’);

// sending to all clients in namespace ‘myNamespace’, include sender
io.of(‘myNamespace’).emit(‘message’, ‘gg’);

// sending to individual socketid‘message’, ‘for your eyes only’);

// list socketid
for (var socketid in io.sockets.sockets) {}
Object.keys(io.sockets.sockets).forEach((socketid) => {});

Official Examples:

Angular +

Video Streaming:


How to Guides

How To: Make a Unity Multiplayer Game using NodeJS

Testing with Moach and Chai

How to: Run NodeJS with on AWS EB

How to: Test with


Real-time Application with


Stream a video using Express.js and

Integrate Socket.IO with Node.Js + Express