Menu

How I built TestMQTT: a browser MQTT client that can still reach TCP brokers
πŸ“°

How I built TestMQTT: a browser MQTT client that can still reach TCP brokers

DEV Community: nextjsΒ·TestMQTTΒ·19 days ago
#p2FCnecI
#devtonextjs#devto#dev#mqtt#broker
Reading 0:00
15s threshold

Most of the time, testing an MQTT broker is a 30-second job: is it up, do these credentials work, what is this device actually publishing? Yet the usual answer was "install a desktop client" or "remember the mosquitto_sub flags again".

So I built TestMQTT , an MQTT client that runs in a browser tab. You open the page, pick a broker and you're connected, with no account and no install.

This post covers the parts that turned out to be interesting:

Why "MQTT in the browser" is really two problems

Connecting over WebSockets with MQTT.js

Reaching plain TCP brokers with a small bridge built on Server-Sent Events and REST

The payload inspector, topic tree and shareable links

Privacy-friendly usage analytics

The stack

Next.js (built with Turbopack): static marketing, learn and tool pages, in 6 languages with localized URLs

MQTT.js : the actual MQTT client for ws:// and wss:// , loaded only when the client page needs it

A small HTTP API on the same origin: the TCP/TLS bridge and the usage log

Windows /…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.