Protocols

An MQTT client online for testing brokers and IoT topics

The Swastik Codes MQTT client connects to an MQTT broker from your browser, subscribes to topics and publishes messages, with the same collections, variables and sharing you use for HTTP APIs. It supports MQTT 3.1.1 and MQTT 5.

Get started freeSign inOpen the app

Every common transport

Connect with the URL scheme your broker exposes:

  • mqtt:// or tcp:// (usually port 1883)
  • mqtts://, ssl:// or tls:// (usually port 8883)
  • ws:// or wss:// for MQTT over WebSockets

For TLS you can provide a CA certificate, plus a client certificate and key when the broker requires mutual TLS. Server certificate verification can be turned off for test brokers with self-signed certificates.

Connection options

Set the client ID, username and password, keep-alive interval and connection timeout. With MQTT 5 you also get the CONNECT properties: session expiry, receive maximum, maximum packet size, topic alias maximum, request response/problem information, user properties and enhanced authentication (authentication method and data). Automatic reconnection re-subscribes your topics when the broker kept no session.

Subscribe to topics

Add topics under Topics, with wildcards (sensors/+/temperature, devices/#) and a QoS level each. MQTT 5 subscription options are available too: no local, retain as published, retain handling and user properties. Incoming messages land in a timestamped log that you can search, filter by topic, view as text, JSON, XML, HTML or hex, and download as JSON.

Publish with QoS, retain and properties

Write a payload as text, JSON, XML, hex or base64, pick the topic, QoS 0, 1 or 2, and whether the message is retained. MQTT 5 publish properties include content type, payload format indicator, message expiry, response topic, correlation data, topic alias and user properties.

JSON
{
  "deviceId": "{{deviceId}}",
  "temperature": 22.4,
  "ts": {{$timestamp}}
}

Frequently published messages can be saved with the request and resent with one click.

Last will and testament

Configure a last will under Last will: topic, payload, QoS, retain and, on MQTT 5, a will delay interval and will properties. It is a quick way to test how your system reacts when a device drops off without disconnecting cleanly.

How it works

  1. Open the app, create a request and change its type to MQTT.
  2. Enter the broker URL, for example mqtts://broker.example.com:8883, choose MQTT 3.1.1 or 5 and set credentials.
  3. Connect, add topic subscriptions and publish messages.

Connecting needs a free account. Browsers cannot open raw TCP connections, so the web app relays MQTT through the Swastik Codes server. That server only connects to public brokers and refuses private and loopback addresses, so a broker on your LAN is not reachable from the web app. The desktop app for Windows and Linux connects from your own machine.

Frequently asked questions

Which MQTT versions are supported?

MQTT 3.1.1 and MQTT 5, including MQTT 5 CONNECT, SUBSCRIBE and PUBLISH properties.

Can I connect to a broker that only offers WebSockets?

Yes. Use a ws:// or wss:// URL; the client uses the mqtt WebSocket subprotocol.

What happens if messages arrive faster than I can read them?

The log keeps up to a large backlog of queued messages; past that, messages are acknowledged but dropped from the display, and the client tells you how many were dropped.

Can I test my company's internal broker?

Only if it is reachable on the public internet. Private network addresses are refused by the web app's server for security.

Try it on your own API

Swastik Codes runs in the browser and is free to use. Create an account to send requests, sync your workspaces and invite your team.