Skip to main content
Logo Triophore
DashIOT DOCUMENTATION

DashIOT MQTT Broker Connection Guide

Detailed instructions on connecting DashIOT to public testing brokers and configuring self-hosted MQTT brokers over WebSockets.

Connecting DashIOT to an MQTT broker requires a WebSocket-compatible endpoint. Because web browsers execute JavaScript inside a sandboxed environment, standard TCP sockets (tcp://...:1883) cannot be opened directly. Instead, browsers establish connections using the WebSocket protocol (ws:// or encrypted wss://).


WebSocket URL Schema

When entering the broker URL in DashIOT, use the following schema:

wss://<broker-domain-or-ip>:<port>/<optional-path>
Protocol Typical Port Encryption Recommendation
wss:// 8084, 8083, 443 TLS Encrypted Recommended for public and cloud brokers
ws:// 9001, 8080 Unencrypted Suitable for local network / private test lab

Browser Security Note: If DashIOT is accessed over HTTPS (as in production), browsers enforce mixed-content restrictions. In this case, you must connect using wss:// (secure WebSockets).


Free & Public Testing Brokers

For rapid prototyping and bench testing, the following public MQTT brokers support WebSockets:

1. EMQX Public Broker

  • WebSocket URL: wss://broker.emqx.io:8084/mqtt
  • Protocol: MQTT v3.1.1 / v5.0
  • Authentication: None required for public test topics.
  • Notes: High availability, global server network. Avoid publishing sensitive data on public topics.

2. HiveMQ Public Broker

  • WebSocket URL: wss://broker.hivemq.com:8884/mqtt
  • Protocol: MQTT v3.1.1
  • Authentication: None required.
  • Port: 8884 (WebSocket with SSL).

3. Eclipse Mosquitto

  • WebSocket URL: wss://test.mosquitto.org:8081/mqtt
  • Protocol: MQTT v3.1.1
  • Port: 8081 (Encrypted WebSockets).

Self-Hosted MQTT Brokers

If you are running your own local or cloud MQTT infrastructure (such as Eclipse Mosquitto, EMQX, or VerneMQ), you must configure a WebSocket listener.

Configuring Eclipse Mosquitto

In your mosquitto.conf configuration file, add a WebSocket listener block:

# Standard MQTT TCP Listener (Hardware / Gateways)
listener 1883
protocol mqtt

# WebSocket Listener (Browser / DashIOT)
listener 9001
protocol websockets
allow_anonymous true

After updating mosquitto.conf, restart the Mosquitto service:

sudo systemctl restart mosquitto

Then connect DashIOT to:

ws://localhost:9001/

(or wss:// via an Nginx reverse proxy with SSL termination).


Troubleshooting Connection Issues

If DashIOT cannot establish a connection to your broker:

  1. Mixed Content Block: Verify your broker URL uses wss:// if the host page is served over HTTPS.
  2. Firewall / Port Forwarding: Ensure port 9001 or 8084 is allowed through your firewall.
  3. CORS & Path: Some brokers require a trailing path, e.g. /mqtt.
  4. WebSocket Headers: Verify reverse proxies (e.g. Nginx, Cloudflare) forward Upgrade and Connection headers properly.