WebSockets and Server-Sent Events
HTTP was designed for request response. The client asks. The server answers. The connection closes. If the client wants new data, it asks again. And again. And again. This works fine for loading a web page. It breaks down when you need real time updates. A chat application needs messages to appear instantly. A stock ticker needs price changes pushed the moment they happen. A collaborative document needs edits from one user to appear on another user’s screen within milliseconds. ...