Server side events is a unidirectionally way to stream notifications/events to clients. It sits on top of TCP/IP and works by keeping a long running connection between client and server through which the server is able to stream event data.
To start the server run:
go run server/main.go
Open the file client/index.html
on your browser.
One can subscribe to the server through http as follows:
curl -X GET http://localhost:8080/sse/subscribe
To send events to all clients subscribed to the same server, run:
curl -X POST http://localhost:8080/sse/dispatch?data=${event-content}