⚡ WebSockets & Real-time
Beginner
What is WebSocket?
Answer
WebSocket is a communication protocol that provides a persistent, full-duplex (bidirectional) connection between a client and a server over a single TCP connection. Unlike HTTP, which is request-response based and stateless, WebSocket keeps the connection open after the initial handshake, allowing either side to send data at any time without the overhead of establishing a new connection. WebSocket is defined in RFC 6455 and is natively supported in all modern browsers via the WebSocket JavaScript API. It is the foundation for real-time features like live chat, notifications, collaborative editing, and live data dashboards.