Using The JavaScript MQTT Client With Websockets

Web browsers use the http protocol and modern ones can also use websockets. However web browsers don’t have MQTT support built in. To publish and subscribe to an MQTT broker with a browser you will need to use a JavaSript MQTT over websockets client. See the MQTT over websockets if you’re not familiar with MQTT over websockets. In this tutorial I will take you through a example script that publishes messages and subscribes to topics using MQTT and websockets.

Continue reading