// server-sent events

Server-Sent Events

Resonance streams text/event-stream responses over a persistent connection, parsing each event and keeping the stream alive with automatic reconnection.

What It Does

  • Streams text/event-stream responses over a persistent connection
  • Sends custom headers on the initial handshake
  • Displays each event with its event, id, retry, and data fields
  • Reconnects automatically, honoring the server’s retry interval
  • Resumes with Last-Event-ID after a reconnect so you don’t miss events
  • Shows the connection lifecycle: connecting, connected, reconnecting, closed, error
  • Persists the transcript per tab

Connecting

  1. Create a request with an SSE endpoint URL — Resonance switches to SSE mode
  2. Add any headers required for the handshake, such as an auth token
  3. Click Connect — events stream into the transcript as the server emits them

Reading Events

Each event is shown with its individual fields parsed out, so you can read the event name, id, suggested retry interval, and data payload separately rather than as one raw blob.

Reconnection & Resumption

  • If the connection drops, Resonance waits the server’s retry interval and reconnects
  • It sends the Last-Event-ID header so the server can resume from where you left off
  • The lifecycle status reflects connecting, reconnecting, and closed states throughout

Troubleshooting

No events appear

  • Confirm the server responds with Content-Type: text/event-stream
  • Make sure the server flushes events rather than buffering the whole response

Constant reconnecting

  • Check the server’s retry value and the stability of the connection
  • For 401 / 403, add the required handshake headers or auth token

Next Steps

  • WebSocket — two-way streaming when you also need to send
  • Getting Started — environments and variables for handshake headers