Direction
Full-duplex: client and server can send at any time.
Half-duplex: server→client only; the client uses separate HTTP requests to send.
If data only flows server→client — live feeds, notifications, dashboards, LLM token streams — Server-Sent Events are simpler, ride plain HTTP, and reconnect automatically. If the client also needs to push messages with low latency, or you need binary frames — chat, multiplayer, collaborative editing — use WebSockets. Many apps pair SSE for streaming with normal POSTs for the occasional client message.
Both keep a connection open for server updates, but the contract differs. SSE is a long-lived HTTP response that streams text events and is built into the browser’s EventSource with auto-reconnect. WebSockets upgrade the connection to a separate full-duplex protocol where either side can send text or binary at any time. The question is whether you truly need the client→server channel.
Full-duplex: client and server can send at any time.
Half-duplex: server→client only; the client uses separate HTTP requests to send.
Upgrades HTTP to a distinct ws:// protocol after a handshake.
Plain HTTP response with content-type text/event-stream — no upgrade.
Text and binary frames.
UTF-8 text only (binary must be encoded, e.g. base64).
Manual: you implement reconnect/backoff and resume logic yourself.
Built in: EventSource auto-reconnects and resumes via Last-Event-ID.
Needs proxies/load balancers that understand WebSocket upgrades and long-lived sockets.
Works through any HTTP infrastructure; nothing special to configure.
One socket per client; scales to many concurrent connections with the right server.
Over HTTP/1.1, browsers cap ~6 connections per origin; HTTP/2+ multiplexing removes that.
A live dashboard, notification feed, or price ticker
One-way streaming with auto-reconnect over plain HTTP is exactly what SSE is for.
Streaming LLM responses to a web client
SSE is the common, low-friction choice; it reconnects and needs no protocol upgrade.
A chat app, game, or collaborative editor
Frequent low-latency two-way messages are the WebSocket sweet spot.
Mostly server push with rare client events
Use SSE for the stream and a normal POST for the occasional client message — simpler than a socket.