Analysis updated 2026-05-18
Connect to a streaming AI chat API that uses POST requests and receive its response as live events.
Build a Server-Sent Events client in Nim with automatic reconnection and resume support.
Implement the server side of an event stream, including replay history and keep alive heartbeats.
Add real TLS hostname verification to a Nim networking project on Windows.
| niminem/sse | gulpf/nimgame2 | ringabout/nimlint | |
|---|---|---|---|
| Stars | 5 | — | — |
| Language | Nim | Nim | Nim |
| Last pushed | — | 2019-06-08 | 2020-12-06 |
| Maintenance | — | Dormant | Dormant |
| Setup difficulty | easy | moderate | easy |
| Complexity | 3/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Install via nimble, no external dependencies needed.
This is a library for the Nim programming language that implements Server-Sent Events, a way for a server to push a continuous stream of small text updates to a client over a single connection. It follows the official web standard closely and uses only Nim's built in tools, with no outside dependencies, talking to sockets directly rather than relying on a separate HTTP library. The library gives you two ways to receive an event stream. An async client works well if your program already runs on Nim's asynchronous dispatch system and you want to handle many streams at once on one thread. A sync client blocks the calling thread instead, which suits simple scripts, command line tools, or programs that give each stream its own dedicated thread. Both clients support the same features: automatic reconnection with increasing wait times between attempts, resuming a stream from where it left off after a disconnect, following redirects, and detecting when a server has gone silent. While the official standard for these events only supports simple GET requests, many modern services, including AI chat APIs, expect a POST request with a JSON body and authentication headers while still streaming the response back as events. This library supports that pattern directly, letting you set a custom HTTP method, extra headers, and a request body. It also warns that automatic reconnection should usually be turned off for these request and response style streams, since reconnecting would resend and effectively rerun the entire original request. For building a server rather than a client, the library provides helper functions that produce correctly formatted event data, automatically assign increasing event IDs, keep a short history of recent events so a reconnecting client does not miss anything, and track when a heartbeat message is needed to keep the connection alive through proxies. These server helpers do not perform any networking themselves. They simply return the properly formatted bytes, so they work with any HTTP server or transport you choose to write them to. The library also includes real TLS hostname verification on every supported platform, including Windows, closing a gap where Nim's standard library normally skips that check.
A dependency free Nim library for both sending and receiving Server-Sent Events streams, including AI style POST based streaming APIs.
Mainly Nim. The stack also includes Nim.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.