Mosquitto 1.4.2 Websocket support

10,901

Solution 1

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

Solution 2

you can modify config.mk like this

in config.mk

# Build with websockets support on the broker.
WITH_WEBSOCKETS:=yes

then can you use a config parameter

listener 10001 127.0.0.1
protocol websockets
Share:
10,901
ns9
Author by

ns9

Updated on June 04, 2022

Comments

  • ns9
    ns9 almost 2 years

    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