Interactive Websocket Chat
△
Introduction
- These components are talking to a NestJS websocket gateway utilising a custom room manager to manage subscriptions.
- Messages and subscription status are available immediately to all connected clients.
- Nest uses Socket IO by default in its Websocket Gateways. It would require custom logic to attach to raw websockets.
- Socket IO provides http like responses for immediate feedback on the success or failure of requests
Basic use
- This is a deliberately simple demonstration but contains all the elements to build more scalable and complex applications
- Create new rooms or join existing ones, the UI updates dynamically to show all available rooms.
- Rooms are create automatically when at least one user joins and are disposed when the subscription reference count reaches zero
Reset all will delete all rooms, memberships and messages!
Available rooms
click to join, double click to enteruser name: