💻 Development + 🌐 Web Technologies intermediate

WebSocket

Protocol providing full-duplex, bidirectional communication channels over a single TCP connection.

WebSockets enable real-time, two-way communication between client and server - unlike HTTP's request-response model. After an initial HTTP handshake, the connection stays open for continuous data exchange. Use cases include: chat applications, live notifications, collaborative editing, gaming, financial tickers, and IoT dashboards. The API is simple: connect, send messages, receive messages, close. Libraries like Socket.IO add features like automatic reconnection and fallbacks. Compared to alternatives: Server-Sent Events (SSE) are simpler but one-way; long-polling works but is inefficient. WebSockets are essential for real-time web applications.