An in-memory publish-subscribe broker via HTTP and Server-Sent Events (SSE), written in Go with no external dependencies.
- Go 1.25+
go run main.goServer listens on :8000.
Publish a message to a topic.
POST /publish?topic=<topic>
Content-Type: text/plain
<message payload>Example:
curl -X POST "http://localhost:8000/publish?topic=news" -d "Hello, World!"
# => okSubscribe to a topic via SSE. The connection stays open and streams messages as they arrive.
GET /subscribe?topic=<topic>Example:
curl -N "http://localhost:8000/subscribe?topic=news"
# => data: Hello, World!.
├── go.mod # Go module definition
├── main.go # Broker, subscriber, message types, HTTP handlers, and entrypoint
└── README.md