Web & APIsIntermediate
WebSockets
PronunciationWEB-sok-its
Definition
A connection that stays open so the client and server can send messages to each other at any time, without new requests.
Where you hear it
Chat apps, live notifications, dashboards, and multiplayer features.
Examples
We use WebSockets to show new messages instantly.
Polling every second is wasteful. Let's switch to WebSockets.
Common mistake
Using WebSockets for everything. If updates are rare, simple polling or Server-Sent Events is easier.