Mosquitto 1.4.2 Websocket support

ns9 picture ns9 · May 21, 2015 · Viewed 10.7k times · Source

I'm trying to utilize Mosquittos recent update to support websockets in the broker. I'm running Mosquitto v1.4.2 and I've added the following lines to the mosquitto configuration file (mosquitto.conf):

listener 10001 127.0.0.1
protocol websockets

listener 1883
protocol mqtt

When I try and start the broker with the new configuration I get the following :

$ mosquitto -c /etc/mosquitto/mosquitto.conf
Error: Websockets support not available.
Error found at /etc/mosquitto/mosquitto.conf:16.
Error: Unable to open configuration file.

I was under the assumption that version 1.4 and above of Mosquitto has websocket support now (don't have to build from source to enable websocket support like you had to before v1.4) so I'm wondering what I'm missing. Any help on what direction to look to troubleshoot the problem is appreciated.

Edit: Forgot to mention I'm running CentOS6

Answer

hardillb picture hardillb · May 22, 2015

While the 1.4.x codebase includes Websocket support it has to be enabled at build time and relies on the libwebsocket library.

The builds currently available in the RedHat/Fedora yum repos do not have Webosockets enabled as there is no libwebsocket package available. I assume CentOS is using the same srpms.

See this bugzilla enrty for details: https://bugzilla.redhat.com/show_bug.cgi?id=1197678