Home/Glossary/WebSocket

WebSocket

WebSocket is a communication technology that allows a web browser and a server to have a continuous, two-way conversation, enabling instant data updates without needing to constantly refresh the page.

How it works

Unlike traditional web requests where the client must ask for new data each time, a WebSocket establishes a single, persistent connection. This allows the server to push new information to the client the moment it's available, making it essential for real-time applications. It works by starting with a standard HTTP handshake and then 'upgrading' the connection to the WebSocket protocol.

Examples

  • 1.Live chat applications in websites or collaboration tools
  • 2.Real-time financial trading dashboards showing live stock prices
  • 3.Multiplayer online games where player actions are instantly visible to others