git404hub

what is sse fr?

niminem/sse — explained in plain English

Analysis updated 2026-05-18

5NimAudience · developerComplexity · 3/5Setup · easy

tl;dr

A dependency free Nim library for both sending and receiving Server-Sent Events streams, including AI style POST based streaming APIs.

vibe map

mindmap
  root((sse))
    What it does
      Server Sent Events for Nim
      Stdlib only
      Spec compliant
    Tech stack
      Nim
      Raw sockets
    Use cases
      AI streaming APIs
      Client reconnection
      Server event helpers
    Audience
      Nim developers
    Features
      Async and sync clients
      TLS hostname verification
      Cancellation tokens

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Connect to a streaming AI chat API that uses POST requests and receive its response as live events.

VIBE 2

Build a Server-Sent Events client in Nim with automatic reconnection and resume support.

VIBE 3

Implement the server side of an event stream, including replay history and keep alive heartbeats.

VIBE 4

Add real TLS hostname verification to a Nim networking project on Windows.

what's the stack?

Nim

how it stacks up fr

niminem/ssegulpf/nimgame2ringabout/nimlint
Stars5
LanguageNimNimNim
Last pushed2019-06-082020-12-06
MaintenanceDormantDormant
Setup difficultyeasymoderateeasy
Complexity3/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 30min

Install via nimble, no external dependencies needed.

in plain english

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.

prompts (copy fr)

prompt 1
Show me how to connect to a Server-Sent Events endpoint in Nim using the async client from this library.
prompt 2
Help me configure the sync client to stream a POST request to an AI API with custom headers and a JSON body.
prompt 3
Write server side code using this library's helpers to send events with a replay buffer for reconnecting clients.
prompt 4
Explain how cancellation with CancelToken works across threads in this library.

Frequently asked questions

what is sse fr?

A dependency free Nim library for both sending and receiving Server-Sent Events streams, including AI style POST based streaming APIs.

What language is sse written in?

Mainly Nim. The stack also includes Nim.

How hard is sse to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is sse for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.