In Chapter 3, Networking with RESTful APIs and Web Sockets Using Flask, we covered a code example using Web Sockets, which included an HTML file and JavaScript web client. In this section, we will also be looking at a Web Socket-based web client built using HTML and JavaScript. However, this time, we will be leveraging the built-in Web Socket features provided by the Mosquitto MQTT broker and the compatible JavaScript Paho-JavaScript Web Sockets library (you will find a link to this library in the Further reading section).
For comparison, in Chapter 3, Networking with RESTful APIs and Web Sockets Using Flask, we created our Web Socket server ourselves in Python using Flask-SocketIO, while our web client used the Socket.io JavaScript Web socket library.
We interacted with the web client we are about to explore to control our LED previously in the Installing the Mosquitto MQTT broker at section ...