/mqttbrowserclient

JavaScript app that connects to IoT Hub from a web browser. Supports sending messages, C2D messages and Direct Methods. Uses the Eclipse Paho JS lib to send MQTT over WebSockets.

Primary LanguageHTMLMIT LicenseMIT

MQTT Browser Client

A JavaScript app that connects to IoT Hub from a web browser. Supports sending messages to IoT Hub, C2D messages and Direct Methods. Uses the Eclipse Paho JS lib to send MQTT over WebSockets. Browser must support WebSockets.

Instructions

  1. Using Azure IoT Explorer, create a device in your IoT Hub.
  2. Paste the Device ID into the index.html clientid field.
  3. In Azure IoT Explorer, select your device and generate a Connection string with SAS Token.
  4. Copy the part of the connection string beginning at SharedAccessSignature sr=... and paste this into the index.html pwd field.
  5. Paste your IoT Hub FDQN (e.g. your_iot_hub_name.azure-devices.net) into the index.html host field.

Screenshot