MQTT over WebSockets

This is a very early/incomplete/broken example of MQTT over Websockets for test.mosquitto.org. Play around with the buttons below, but don't be surprised if it breaks or isn't very pretty. If you want to develop your own websockets/mqtt app, use the url ws://test.mosquitto.org/mqtt , use subprotocol "mqtt" (preferred) or "mqttv3.1" (legacy) and binary data. Then just treat the websocket as a normal socket connection and read/write MQTT packets.

Usage

Click Connect, then use the Publish and/or Subscribe buttons. You should see text appear below. If you've got another mqtt client available, try subscribe to a topic here then use your other client to send a message to that topic.

Broker

Publish

Topic:

Payload:

Subscribe/Unsubscribe

Topic: