/sse-poc

A POC app to demo Server Side Events (SSE)

Primary LanguageGo

SSE Poc

Purpose of this repository is to understand the usage of Server Side Events using Go.

Demo

Screen Recording 2023-01-20 at 4 28 44 PM

Usage

  1. To run the server

    go run server/server.go
  2. In a different terminal. Run an in-built client

    go run client/client.go

    Or open the index.html file in a browser and click on Trigger Event button.

  3. Once the server is up, and you have a client running, send a trigger to /trigger endpoint

    curl -i localhost:8080/trigger
  4. The client will show the data that was emitted from server. Any other client can connect on the following url

    http://127.0.0.1:8080/events?stream=messages

Resources