WebSocket
also: WebSockets, WS
A communication protocol that enables two-way, persistent connections between a client and server over a single TCP connection, allowing real-time data exchange with lower overhead than repeated HTTP requests.
WebSocket is a protocol built on top of TCP that upgrades an initial HTTP connection into a full-duplex communication channel. Unlike HTTP, which requires a new request-response cycle for each data exchange, WebSocket maintains an open connection allowing the server to send data to the client at any time without waiting for a request.
WebSocket is initiated with an HTTP upgrade handshake: the client sends an HTTP request with Upgrade: websocket headers, and if the server accepts, the connection switches to the WebSocket protocol. This reduces latency and overhead significantly for applications requiring frequent updates.
Common Linux use cases include real-time chat applications, live notifications, collaborative tools, and online gaming. Tools like nc, curl (with websocket support), or dedicated libraries like libwebsockets can interact with WebSocket services on Linux systems.
While WebSocket itself is protocol-agnostic, on Linux servers it's typically implemented through application frameworks (Node.js Socket.io, Python libraries) rather than at the kernel level.