HiveMQ

Problem with websockets

Moin,

I used to use mqtt with mosquitto. Now i want to switch. The bare mqtt works with hiveMQ (hivemq-ce-2020.2), the web sockets unfortunately not. From the config.xml:

9001
0.0.0.0
/

mqttv3.1
mqtt

true

With the test script publish-socks.py [1] I don’t get a connect while it works with the old mosquitto server:

paho.mqtt.client.WebsocketConnectionError: WebSocket handshake error
But with curl I get an understandable error message from hiveMQ:
$ curl 44.148.177.74:9001
not a WebSocket handshake request: missing upgrade

What am I doing wrong? Grateful for hints.
[1] http://www.steves-internet-guide.com/downloads/#websock

Hi @Fantaa,

Glad to see you want to switch to HiveMQ CE.
Unfortunately the formatting of your config.xml appears to be messed up.
You can find the information on how to configure a websocket listener here.
Seems like the xml tags get removed.
I would guess that you are running in to a mismatch between your configured websocket path ("/") and what the paho library uses (either “/mqtt” or “/ws”)
See this StackOverFlow question.

Hope this helps.
Florian

1 Like

Moin,

thanks for your answer that helped me. I don’t know when I turned /mqtt to / (probably when I was still experimenting with hivemq). But with the change to /mqtt everything worked as it should.

Greetings