Using WebSockets
WebSockets is a communications protocol (https://en.wikipedia.org/wiki/Communication_protocol) that provides full-duplex (https://en.wikipedia.org/wiki/Duplex_(telecommunications)#FULL-DUPLEX) communication channels over a single TCP connection between client and server. It allows clients to send messages to the server and receive server events over the same TCP connection without polling. Compared to Server-Sent Events (SSE) (https://www.w3.org/TR/eventsource/), WebSockets support full-duplex communication between client and server instead of a one-way push. Also, SSEs are implemented over HTTP, which is an entirely different TCP protocol compared to WebSocket. Although both protocols are different, they both depend on the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access