How does WebSocket differ from HTTP?
Answer out loud or in your head first, then compare.
Answer
In typical use of HTTP, the client sends a request and the server responds to it. Once a WebSocket connection is established, both sides can send further messages without a separate HTTP request for each. That's convenient when the exchange is frequent and goes both ways.
That doesn't mean HTTP always closes the connection after a response, or that it can't send data gradually. HTTP also supports streaming, e.g. via SSE. For fetching a profile, a plain HTTP API is simpler. For frequent, two-way live collaboration, a WebSocket may fit better.
Why it matters: Prevents the popular simplification “HTTP is short, WebSocket is long”.
Possible follow-ups: Does streaming text from a model require a WebSocket?
How did it go? Be honest — “Not yet” puts the question on your review list.
Further reading
- MDN: WebSocket API(opens in a new tab)Accessed 22.10.2026. The connection, two-way messages and limits of the browser API.
- MDN: Overview of HTTP(opens in a new tab)Accessed 22.10.2026. Requests, responses and connection reuse.