© Neil Cameron 2021
N. CameronElectronics Projects with the ESP8266 and ESP32https://doi.org/10.1007/978-1-4842-6336-5_9

9. WebSocket

Neil Cameron1  
(1)
Edinburgh, UK
 

The WebSocket protocol (www.websocket.org) allows a two-way real-time conversation between the web server and client, through a standardized connection to allow both the server and the client to send data at any time. The client sends a request to the server to switch from an HTTP protocol to a WebSocket protocol; and if the server can host the WebSocket protocol, the HTTP connection is replaced with a WebSocket connection, but using the same port as HTTP.

An example of the WebSocket protocol is transmitting and receiving text in a conversation between the web server and the client (see ...

Get Electronics Projects with the ESP8266 and ESP32: Building Web Pages, Applications, and WiFi Enabled Devices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.