📡 Real-Time Streaming Reference

Master Server-Sent Events
& Real-Time Streaming

The definitive technical reference for engineers building real-time systems. 185 in-depth guides across four sections: protocol internals and proxy configuration, servers in Node.js, Python, Go, Java, .NET and Rust with Redis, Kafka and NATS fan-out, clients for every framework and runtime, and complete real-time features — dashboards, notifications, job progress, log tailing, presence and market data.

What You'll Find Here

Server-Sent Events (SSE) provide a standardised, unidirectional HTTP streaming protocol purpose-built for server-to-client real-time communication. Unlike WebSockets or long-polling, SSE operates over plain HTTP/1.1 or HTTP/2, requires no protocol upgrade, and delivers automatic reconnection with cursor tracking out of the box through the browser's native EventSource API.

This site covers the full production stack across four sections. SSE protocol fundamentals dig into the event stream format, event IDs and retry, HTTP/2 and HTTP/3 multiplexing, proxy and CDN configuration, security headers, and cross-browser support. Backend stream generation covers serving SSE from Node.js, Python/FastAPI and Go — with connection pooling, buffer management, Redis pub/sub fan-out, rate limiting and backpressure, idempotent event IDs, observability, and edge and serverless deployment. Frontend consumption covers React and Vue EventSource hooks, state-management integration, streaming AI responses token by token, reconnection UX, and mobile background-tab handling — plus fetch-based and non-browser clients, Angular and Svelte, and sharing one stream across tabs. Real-time application patterns put the pieces together into complete features: live dashboards, notification feeds, progress for long-running jobs, log and CI output streaming, collaborative presence, and market data and live scoreboards.

Whether you're building telemetry dashboards, notification pipelines, live data feeds, or migrating from polling to persistent streams, every guide provides production-grade code examples, edge case mitigations, and actionable deployment directives.

Start Here

Four pages that answer the questions engineers ask first.

Browse by Section

Four comprehensive sections covering the full SSE stack — from protocol internals, backend generation and frontend consumption to complete real-time features.

Recent Deep Dives

All Topics

Browser Support & Polyfill Strategies EventSource support matrix, polyfill options, fetch+ReadableStream fallbacks, and tiered degradation patterns for production SSE deployments. Event ID & Retry Mechanism Design How SSE event IDs and retry directives enable deterministic stream resumption: wire format, server-side cursors, backoff design, and production edge cases. HTTP/2 and HTTP/3 for Event Streams How SSE behaves over HTTP/2 and HTTP/3: multiplexing away the six-connection cap, header compression, flow control, QUIC migration, and the settings that matter. Proxy & CDN Configuration for SSE Copy-paste proxy configuration for Server-Sent Events: nginx, HAProxy, Envoy, Caddy, AWS ALB and CDN edges — buffering, timeouts, compression and the settings that break streams. Security Headers for Event Streams Complete guide to HTTP security headers for SSE endpoints: CORS, CSP, auth, X-Accel-Buffering, and production hardening for long-lived streams. SSE vs WebSockets vs HTTP Polling Compare SSE, WebSockets, and HTTP polling on latency, connection overhead, directionality, proxy compatibility, and scaling to pick the right transport. Understanding the Event Stream Format Complete field-by-field reference for the text/event-stream wire format: data, event, id, retry, comments, framing rules, and parser edge cases. ASP.NET Core SSE Implementation Serve Server-Sent Events from ASP.NET Core — TypedResults.ServerSentEvents, manual streaming with flushes, Channels for fan-out, Kestrel limits and cancellation. Buffer Management & Chunked Transfer Encoding Master HTTP chunked transfer encoding, flush timing, watermark tuning, and proxy buffering bypass for production SSE streams across Node.js, Python, and Go. Connection Pooling for SSE Servers How to manage thousands of long-lived SSE connections: FD limits, worker tuning, pooled sockets, heartbeats, and graceful drain under load. Edge & Serverless SSE Deployment Run Server-Sent Events on edge and serverless runtimes: Web Streams on Workers and Deno, Lambda response streaming, execution-time ceilings, statelessness and cost per open stream. Go Streaming Patterns for SSE Idiomatic Go SSE using http.Flusher, goroutines, channels, context cancellation, and graceful shutdown — with production-ready patterns. HTTP Keep-Alive & Connection Lifecycle How HTTP Keep-Alive, TCP keepalives, heartbeats, and teardown interact for long-lived SSE streams — config, edge cases, and production ops. Idempotent Event ID Generation Assign collision-free, monotonic IDs to SSE events so clients can resume streams after disconnection without duplicates or missed events. Java & Spring SSE Implementation Serve Server-Sent Events from Spring Boot — SseEmitter on Spring MVC, Flux of ServerSentEvent on WebFlux, timeouts, disconnect handling and thread budgets. Kafka & NATS as SSE Event Sources Feed SSE streams from Kafka, NATS JetStream or Postgres LISTEN/NOTIFY — consumer design per node, offsets as event ids, durable replay and fan-out at scale. Node.js Streaming Architecture Basics Build reliable SSE endpoints in Node.js: headers, res.write, flush, heartbeats, backpressure, disconnect cleanup, and production ops. Observability & Metrics for SSE Instrument long-lived event streams: the metrics that matter, Prometheus and OpenTelemetry wiring, structured logging for connections that outlive requests, and the alerts worth paging on. Python FastAPI SSE Implementation Guide Ship production SSE endpoints with FastAPI: StreamingResponse, async generators, sse-starlette, ASGI tuning, proxy buffering, and scale considerations. Rate Limiting & Backpressure Handling Token-bucket rate limiting, slow-consumer backpressure, and drop policies for SSE servers — Node.js, Go, and Python patterns with production ops. Redis Pub/Sub Fan-Out for SSE Decouple SSE producers from connections using Redis pub/sub. Multi-node broadcast, channel design, at-least-once delivery, and backpressure strategies. Rust SSE with Axum and Tokio Serve Server-Sent Events from Rust with axum's Sse response, tokio broadcast channels, keep-alive comments, disconnect cleanup via Drop and bounded memory. Testing & Load Testing SSE Endpoints Test SSE at every level — frame encoder unit tests, replay integration tests, browser E2E, proxy chaos tests and load tests that hold real connections. Collaborative Presence & Live Updates Build presence, live cursors and collaborative updates with SSE down and HTTP up — lease-based presence, per-document channels, ordering and conflict handling. Live Dashboards & Metrics Feeds SSE dashboards that stay correct across reconnects and smooth under load — snapshot-then-delta streams, server-side sampling, frame-rate rendering. Log Tailing & CI Output Streaming Stream logs and build output to the browser over SSE — byte-offset cursors, bounded replay, burst batching, server-side filters and virtualised rendering. Market Data & Live Scoreboards Stream prices, order books and live scores over SSE at high rates — conflation per key, sequence gap detection, snapshot recovery and fan-out to many viewers. Notification & Activity Feeds Deliver in-app notifications and activity feeds over SSE without losing or duplicating items — per-user channels, durable cursors, unread counts, and replay. Progress Streaming for Long-Running Jobs Stream progress for exports, imports and builds over SSE — job state machines, terminal events, late joiners, reconnects and closing the stream cleanly. Angular & Svelte SSE Integration Integrate Server-Sent Events into Angular and Svelte — RxJS Observables and signals, Svelte stores and runes, zone-aware updates, SSR safety and teardown. Error Handling & Reconnection UX Implement SSE reconnection with exponential backoff, surface connection state to users, handle stale data, and design graceful degradation for unreliable networks. Fetch-Based SSE Clients Consume SSE with fetch and ReadableStream when EventSource is not enough — custom headers, POST bodies, real status codes and your own reconnect loop. Mobile & Background-Tab Handling Manage SSE connections across Page Visibility changes, mobile tab suspension, battery constraints, and resume with Last-Event-ID to avoid event loss. Non-Browser SSE Clients Consume Server-Sent Events outside the browser — Node.js, Python, Go, iOS and Android clients, the parts of EventSource you must rebuild, and production defaults. React EventSource Hooks & State Encapsulate EventSource in React hooks for lifecycle-safe SSE: cleanup, re-render control, error handling, and concurrent-mode compatibility. Sharing One SSE Connection Across Tabs Run one SSE stream per browser instead of one per tab — SharedWorker hubs, BroadcastChannel leader election, lifecycle, reconnect ownership and fallbacks. State-Management Integration for SSE Feed SSE events into Redux, Pinia, and Zustand: action dispatch, normalization, optimistic updates, deduplication, and backpressure patterns. Streaming AI Responses in the Browser Build token-streaming UIs on SSE: incremental rendering, partial markdown, cancellation, backpressure on fast token streams, and resuming a generation after a dropped connection. Vue EventSource Composables Build reactive Vue 3 composables for SSE: useEventSource with ref-based state, onUnmounted cleanup, typed events, and exponential-backoff reconnection.