Skip to content
H

SSE Learning Demo

This page shows the basic SSE loop: the server keeps an HTTP response open, and the browser listens with EventSource for incoming messages.

What to notice

Server-Sent Events are useful when the browser only needs data pushed from the server. They are simpler than WebSockets for one-way streaming because the browser keeps a regular HTTP connection open and receives text-based event frames.

In this example, the route sends a named connected event once and a tick event every 2 seconds. The client subscribes with EventSource and updates the UI as each event arrives.

Good SSE fits

  • Live dashboards and activity feeds
  • Progress updates for long-running server work
  • Notifications where the server only needs to push data one way

Direction: server to client only

SSE Client Demo

Open a stream, watch named events arrive, and disconnect when you are done inspecting the flow.

Status

idle

Tick Count

0

Latest Event

No events yet

Connect to start the stream.

Latest Payload

{
  "message": "Waiting for SSE data..."
}

Recent Event Log

  • Connect to see the stream log fill in.