Namespaces are a way of separating the business logic of your application while reusing the same TCP connection or minimizing the need for creating new TCP connections for to implement real-time communication between the server and the client.
Namespaces look pretty similar to ExpressJS' route paths:
/home /users /users/profile
However, as mentioned in previous recipes, these are not related to URLs. By default, a single TCP connection is created at this URL http[s]://host:port/socket.io
Reusing the same event names is a good practice when using namespaces. For example, let's suppose that we have a Socket.IO server that we use to emit a setWelcomeMsg event when the client emits a getWelcomeMsg event:
io.of('/en').on('connection', (socket) => { socket.on('getWelcomeMsg', () => { socket...