Technical Glossary

WebSocket

Definition: Bidirectional, persistent communication protocol that enables real-time data exchange between client and server over a single TCP connection.

— Source: NERVICO, Product Development Consultancy

What is WebSocket

WebSocket is a communication protocol that establishes a bidirectional, persistent channel between a client (typically a browser) and a server. Unlike HTTP, where the client always initiates communication, WebSocket allows both parties to send data at any time without opening new connections. It is established through an initial HTTP handshake that then upgrades to a permanent WebSocket connection.

How it works

The connection begins with a standard HTTP request that includes an Upgrade: websocket header. If the server accepts, the connection is upgraded from HTTP to WebSocket and remains open. From that point on, client and server exchange messages (frames) independently. There is no HTTP header overhead on each message, which drastically reduces latency. The connection stays alive until either party explicitly closes it.

Why it matters

Many modern applications require real-time updates: chats, monitoring dashboards, collaborative editors, financial quotes. With traditional HTTP, the only option is polling (repeatedly querying the server), which generates unnecessary traffic and latency. WebSocket eliminates this problem by providing an always-open channel where data flows instantly in both directions.

Practical example

A project management tool implements a collaborative Kanban board. Without WebSocket, each user would need to refresh the page to see changes made by other team members. With WebSocket, when a user moves a card between columns, the server instantly sends the update to all other connected users. The movement appears on everyone’s screens in under 50 milliseconds.

Need help with product development?

We help you accelerate your development with cutting-edge technology and best practices.