WebSocket
Noun · Development · Origin: 2011
Definitions
WebSocket is a communication protocol that provides full-duplex, bidirectional communication between a web browser and a server over a single, persistent TCP connection. Unlike HTTP, which follows a request-response pattern where the client must initiate every exchange, WebSocket allows either side to send messages at any time after the connection is established. The connection starts as a standard HTTP request with an Upgrade header and, once the server agrees, switches to the WebSocket protocol. This eliminates the overhead of repeatedly establishing new HTTP connections and enables real-time data transfer with minimal latency. WebSocket is the technology behind live chat applications, multiplayer games, real-time collaboration tools, stock tickers, live sports scores, and notification systems. The protocol operates on ports 80 (ws://) and 443 (wss:// for encrypted connections). Server implementations exist for every major platform, and the browser-side API is straightforward. Alternatives for real-time communication include Server-Sent Events (SSE) for one-way streaming and HTTP long polling.
In plain English: A persistent two-way connection between a website and a server, allowing instant communication in both directions — like a phone call instead of sending letters back and forth.