WebSocket
One TCP connection, kept open, messages flowing both ways — how dashboards get live vitals without polling.
In one line
WebSocket upgrades an ordinary HTTP request into a persistent, full-duplex connection, so server and client can push messages to each other the instant something happens.
How it works
The client sends an HTTP request with Upgrade: websocket; after the handshake the
same TCP connection carries lightweight frames in both directions until either side
closes it. Compared with HTTP polling: no per-request overhead, millisecond latency.
Compared with MQTT: no broker, no topics, no QoS — just a pipe; many systems actually
run MQTT over WebSocket so browsers can join broker traffic.
Where it shows up in digital health
Live vital-sign dashboards, bed-board updates, chat in patient portals, WebRTC's signaling channel, and streaming AI responses token-by-token (Vaidya will use exactly this pattern). The rule of thumb: request/response → HTTP; server push to browsers → WebSocket (or SSE); device fleets → MQTT.