A simple implementation of a concurrent broadcast server that dispatches a message to the connected clients via the websocket protocol.
Components:
consists of:
- A counter that gets incremented frequently and its value will be broadcasted to all clients.
- A hub component that registers and de-registers clients and broadcasts the counter value to the clients.
This is a basic React app that acts as a client to the broadcast server, which:
- Establishes a websocket connection to the server and displays a green background upon a successfull connection.
- Starts reading the counter value and displaying it.
- Changes the background to red when the websocket connection closes or errors out.