6. WebSocket Communication: Socket.io is used for WebSocket-based communication. The server listens for various events, such as "new-user," "join-room," "message," and "disconnect," to facilitate real-time interactions among users. Users can send and receive messages and join specific rooms.