MQTT Click Counter (HiveMQ Public Broker)
Uses secure WebSockets to
broker.hivemq.com:8884
(public broker). 2
Counter lives in a retained topic; every click publishes a new retained count.
idle
clientId:
Broker (Host)
Secure WebSocket Port (WSS)
WebSocket Path
Topic base
Connect
Disconnect
Count topic (retained)
Event topic
—
no updates yet
CLICK (publish +1)
Reset to 0 (retained)
Tip: open this page in two tabs; clicks in one tab update the other via the retained count topic.
Log
QoS:
0
| Retain:
count=yes
Clear log
Copy log
mqtt.js auto-reconnects by default; you’ll see reconnect events in the log. 3