Direct MQTT vs MQTT over WebSocket [closed]

You should only need to run MQTT over websockets if you intend to publish/subscribe to messages directly from within webapps (in page).

Basically I would run pure MQTT for everything and only add the websockets if you actually need it.

For all the non-browser languages the MQTT client libraries only use native MQTT. For Javascript there is both a pure MQTT library and the Paho in page library that uses websockets.

Edit:
The firewall tunnelling use case is a valid reason to use MQTT over websockets and since writing this answer more of the none web/JavaScript client libraries have added support

Leave a Comment