This simple app demonstrate PubSub pattern using Node/WS/Express server and WebSocket client APIs.
- Run server.
npm install
node index.js
- Open subscriber (sub.html). You can open multiple subscribers. Select desired channel and click Subscribe.
- Open publisher (pub.html). Input desired channel and message to publish. Click Publish.
- All the subscribers subscribed to given channel will recieve the message.
- To close the server just press Ctrl+C in terminal.
- Allow pub/sub simultaneously.
- Differentiate pub/subs in backend.
- Use database to store message queue.
- Better error handling.