A bidirectional, full-duplex communication protocol over a single long-lived TCP connection. It enables real-time server-to-client push (chat, live dashboards, collaborative editing) without HTTP polling.
WebSocket starts as an HTTP request that 'upgrades' to a persistent connection where either side can send messages at any time. Compared to HTTP polling (client repeatedly asks 'anything new?'), WebSocket is dramatically more efficient for low-latency push: chat messages, live notifications, collaborative cursors, real-time prices. Major frameworks (Django Channels, FastAPI WebSocket, Socket.IO) handle the protocol; behind the scenes you're managing connection lifecycle, broadcasting to subscribers, and handling reconnection.
Building a live dashboard that pushes Postgres NOTIFY events through WebSocket to 500+ connected browsers in under 100ms.
WebSocket is the right primitive any time the user experience needs to feel live, and anything less feels dated in 2026.
Need help implementing this in your business?
Get Started