Many websites and applications still work on a simple principle: you request something, the server looks it up, and sends the answer back. For a page that rarely changes, that's fine. But in processes where every second counts, this quickly becomes a bottleneck. And in an era where the demand for more and more real-time information is the norm, this approach no longer works. In the past, this was solved with 'polling': the application keeps asking in the background, “is there anything new yet?” Every few seconds, even though the answer is almost always "no." This wastes unnecessary server capacity, drives up your cloud/hosting costs, and still results in delays.
In cases where a real-time solution is truly needed, we increasingly choose a different approach: a permanent, secure connection between the user's screen and the server. As soon as something changes, the server immediately pushes that information through—no need to request anything. The result: updates are visible within a fraction of a second, instead of after a few seconds' wait. Technically, this means an HTTP request is sent to the server, which responds in the header indicating it's a special websocket connection. This way, the browser and server understand each other and switch to a specific WebSocket protocol (ws:// or wss:// for a secure variant). From that moment on, a connection remains open for bi-directional data transfer.