Hi everyone,
We just open-sourced go.jetify.com/sse a tiny, dependency-free library to handle Server Sent Events in Go. It has extensive unit tests and follows the WHATWG Spec (we're intending to be fully compliant, but let us know if you find an example where we're not!)
At our company we're building all of our AI agents and related infrastructure using Go. Many LLM providers like OpenAI and Anthropic use SSE as their streaming protocol, and we needed to be able to handle it.
Existing SSE libraries seemed to be bigger than what we needed, and they often included their own server implementation – which we didn't need.
We were instead looking for something small, primarily focused on handling the SSE encoding correctly, and compatible with the http package from the stdlib – so that's what we built.
If you need SSE handling, feel free to give it a try.