Server to stream a JSON file over Server-Sent-Events (SSE) to a client/browser.
Install Go as described: https://golang.org/doc/install and then:
make dev-dependencies
make release
make test
./sseserver-<os>-<arch> -inputFile <file-to-serve>
Open examples/test_sse.html
to receive the SSE events.
kill -HUP <PID of sseserver>
The sseserver
works nicely when combined with Consul Template to stream information from Consul to clients/browsers.
./consul-template \
-template=/endpoints.ctmpl:/endpoints.json \
-exec='./sseserver -enable-syslog -context /endpoints -input-file /endpoints.json' \
-exec-reload-signal=SIGHUP