skip to content
szczecin 53.43N 14.55E ./start-project

nuts 0.6.1

Real-time NATS in the browser: a Caddy module that streams NATS JetStream messages to browsers over Server-Sent Events.

open source · bsd-4-clausefreego + nats jetstream + caddy
NUTS(1)User CommandsNUTS(1)

NAME

nuts - real-time NATS in the browser: a Caddy module that streams NATS JetStream messages to browsers over Server-Sent Events

DESCRIPTION

NUTS is a Caddy module that bridges NATS JetStream messages to Server-Sent Events. Browsers subscribe with the standard EventSource API and pick topics with query parameters; one connection can carry many topics.

Messages live in JetStream, so retention, storage and replay stay in NATS. A client that reconnects sends Last-Event-ID and gets what it missed. It is inspired by Mercure and built for teams already running NATS. This site uses it for its live admin panel.

FEATURES

--sse
Stream NATS messages to browsers instantly via the standard EventSource API.
--jetstream
Messages live in NATS JetStream: retention, storage and replay stay in NATS.
--replay
Resume from any point with last-id or the standard Last-Event-ID header.
?topic=
Subscribe to many NATS subjects in a single SSE connection with repeated topic parameters.
--backpressure
Slow clients are disconnected cleanly so they can reconnect and replay.
--jwt
HMAC-signed JWTs with per-topic subscribe claims, read from a header or a cookie.
--metrics
Built-in nuts_* Prometheus counters and gauges, on Caddy's metrics endpoints.
--tls
TLS and mTLS between NUTS and your NATS cluster.
Caddyfile
A first-class Caddy module: configure it in a Caddyfile or JSON and inherit Caddy's TLS and routing.
all features: nuts --features →

$ nuts --price

free

  • Free to use in commercial and personal projects
  • Source code on GitHub under the BSD 4-Clause license

$ nuts --install

v0.6.1 · release notes ↗

# install: or docker pull idcttech/nuts:v0.6.1 $ xcaddy build --with github.com/ideaconnect/nuts
github ↗