MQTT over WebSockets

This is a very early/incomplete/broken example of MQTT over Websockets for 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:// , use subprotocol "mqttv3.1" and binary data. Then just treat the websocket as a normal socket connection and read/write MQTT packets.

The server is running a patched version of lighttpd with the third party mod_websocket included. If you're on ubuntu you can find packages for the patched lighttpd with mod_websocket at


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.