sse

command
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

sse demonstrates the simplest SSE pattern in gogo: register an async route, install Server-Sent Events via res.SSE, and emit events on a timer with a keepalive ping every few seconds.

Run:

CGO_ENABLED=1 go run -tags gogo ./examples/sse

Then open the browser to http://localhost:3000/ — the embedded HTML page subscribes to /events via the standard EventSource API and renders each tick.

Or stream from the CLI:

curl -N http://localhost:3000/events

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL