-
It creates a connection between a client and a server that allows text to be passed back and forth between them.
-
Console logs record when a user connects or disconnects as well as when a message is sent.
-
Broadcast sends an event to everyone except the sender.
-
A room is a channel that sockets can join and leave.
-
socket.join('room name')
joins a room -
socket.leave('room name')
leaves a room
-
A Namespace is a communication channel that allows you to split the logic of your application over a single shared connection
-
Each namespace as its own event handlers, rooms, and middlewares.
-
If some functionality is only supposed to be available to authorized users, a namespace can separate that logic from the rest of the app.