freecoding.school100% FREE · NO SIGNUP
Endpoint BayISSUE #28 of 45

server-sent events · one-way realtime

RestaVSThe 401 Bandit
Resta saysServer-Sent Events stream one-way server→client updates over plain HTTP.

SSE is the lightweight middle ground: the server holds an HTTP connection open and pushes text events; the browser's EventSource receives them and auto-reconnects. It's simpler than WebSockets and needs no special protocol — ideal for notifications, live feeds, and progress where the client doesn't need to talk back. One-directional by design.

Power-ups you unlock

The 401 Bandit attacks — common mistakes

Boss battleDecide between SSE and WebSocket for a live "order status" feed.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>order status = server pushes, client just listens
→ SSE (simpler than a full WebSocket)</pre></body></html>
▶ Open the interactive comic issue
‹ Websockets · Bidirectional RealtimePolling Vs Long-Polling Vs Push ›