12.3 WebSockets
The central component of the chat application is the communication link between client and server. Through it, the user can send messages to the server and receive messages from the server. The WebSocket API is an established and widely used technology developed in the wake of HTML5 that solves the problem of bidirectional communication in web applications at the protocol level. (Details of this specification can be obtained from W3C at www.w3.org/TR/2009/WD-websockets-20091222/.) Its browser provides you—the programmer—with an interface in JavaScript through which you can communicate with the other side using the WebSocket. The actual connection, that is, the WebSocket, is independent of HTTP. Instead, the WebSocket specification, ...
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