Integrate MQTT using Websocket with a Webpage

Introduction

Method

1. Environment

2. Publisher

  1. Create pub.html as per below code
  2. Create demo.js as per below code

3. Subscriber

  1. Create sub.html as per below code
  2. Create demo.js as per below code

4. Styling Sub.html

Reference site:

  1. https://www.thomaslaurenson.com/blog/2018/07/10/mqtt-web-application-using-javascript-and-websockets/