> For the complete documentation index, see [llms.txt](https://edward-stevinson.gitbook.io/tech-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edward-stevinson.gitbook.io/tech-notes/computer-science/websockets.md).

# Websockets

A WebSocket is a communications protocol, providing full-duplex communication over a single TCP connection. WebSocket is a different TCP protocol from HTTP (though both are level 7 in the OSI model). The WebSocket protocol enable interaction between a browser and a web server with lower overheads, facilitating real-time data transfer from and to the server.

## Full Duplex

A **full-duplex (FDX)** system (or double duplex) allows communication in both directions and, unlike half-duplex, allows this to happen simultaneously. An example of a full-duplex system would be a landline telephone.

## Other

**Half-open socket** is caused when one side of the HTTP proxy is open and the other is closed, leading to a situation where the server thinks that everything is OK.
