MQTT over WebSocket Debugger
Debug MQTT brokers over WebSocket directly in your browser using MQTT.js: connect to ws:// or wss:// endpoints, manage multiple subscriptions, publish with QoS and Retain, watch the full MQTT packet log, explore a live topic tree with value history, and export sessions or generated client code.
Publish
Subscriptions
Topic tree
How to use the MQTT over WebSocket Debugger
This tool connects to an MQTT broker over WebSocket using MQTT.js, right from your browser. It lets you subscribe to topics, publish messages, and inspect every MQTT packet exchanged. Nothing is sent to us — the WebSocket goes straight to the broker you specify.
1. Configure and connect
- Broker URL — point at the broker's WebSocket listener, usually port 8083 (ws) or 8084 (wss) with a path such as /mqtt (e.g. ws://192.168.1.10:8083/mqtt). On an HTTPS page you can only connect to wss:// with a valid certificate.
- Client ID — leave blank to auto-generate one. For a persistent session, fix it and uncheck Clean session.
- Protocol — choose MQTT 3.1.1 or MQTT 5. MQTT 5 exposes Clean Start + Session Expiry and advanced features such as User Properties, Topic Alias, Response Topic and shared subscriptions ($share/group/...).
- Keep Alive — seconds between PINGREQ packets (0 disables). Default 30.
- Last Will — topic, payload, QoS and Retain are fully configurable; the broker publishes it if the connection drops unexpectedly.
- Auto reconnect — reconnect with exponential back-off; disable to stop.
2. Subscribe
Add multiple subscriptions, each independent. Wildcards are supported: + matches a single level, # matches all remaining levels (must appear at the end). Each subscription tracks its own message count and unread indicator, and can be paused, resumed or cleared.
3. Publish
Pick a topic, QoS (0/1/2) and Retain flag, then choose the payload type — Text, JSON, Base64 or HEX. Templates support variables such as {{rssi}}, {{ts}} and {{rand}}, replaced at publish time.
4. Inspect the packets
The log shows every MQTT packet with direction, topic, QoS, Retain flag, byte count and timestamp: CONNACK, SUBACK, UNSUBACK, PUBACK/PUBREC/PUBREL/PUBCOMP for QoS 1/2 handshakes, PINGREQ/PINGRESP and DISCONNECT (including the MQTT 5 reason code). CONNACK return codes and per-topic SUBACK codes (accepted / rejected / QoS downgraded) are explained in plain language.
5. Topic tree & value history
The topic tree expands by level; each leaf shows the latest value and update time. Numeric topics draw an automatic history curve, and JSON payloads render as a collapsible, copyable tree.
6. Export & code generation
Export your subscription configuration plus recent message samples as JSON, or generate ready-to-use client snippets for MQTT.js / Paho (Python / Node / Arduino) based on the current connection settings.
Browser limitations to know
- Browsers do not allow arbitrary HTTP headers on the WebSocket handshake — authentication goes through the MQTT Username/Password fields.
- Protocol-level ping/pong is handled automatically by MQTT.js via Keep Alive; you cannot send raw PINGREQ manually.
- wss:// requires a valid TLS certificate on the broker.