# Problem with websockets

**URL:** <https://community.hivemq.com/t/problem-with-websockets/186>\
**Category:** HiveMQ Community Edition\
**Created:** [March 18, 2020, 7:55pm UTC](https://community.hivemq.com/t/problem-with-websockets/186 "2020-03-18T19:55:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fantaa](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/fantaa/32/53_2.png) [@Fantaa](https://community.hivemq.com/u/Fantaa)\
**Post date:** [March 18, 2020, 7:55pm UTC](https://community.hivemq.com/t/problem-with-websockets/186/1 "2020-03-18T19:55:18Z")

</div>

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](http://www.steves-internet-guide.com/downloads/#websock)

---

<div class="post-metadata">

**Author:** ![hivemq-support](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/hivemq-support/32/357_2.png) [@hivemq-support](https://community.hivemq.com/u/hivemq-support)\
**Post date:** [March 18, 2020, 8:33pm UTC](https://community.hivemq.com/t/problem-with-websockets/186/2 "2020-03-18T20:33:32Z")

</div>

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](https://github.com/hivemq/hivemq-community-edition/wiki/Listener-configuration#ws-listener).  
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](https://stackoverflow.com/questions/41746704/websocket-connection-error-with-hivemq-2-1-0-paho-javascript-mqttws31-js/41761925#41761925).

Hope this helps.  
Florian

---

<div class="post-metadata">

**Author:** ![Fantaa](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/fantaa/32/53_2.png) [@Fantaa](https://community.hivemq.com/u/Fantaa)\
**Post date:** [March 20, 2020, 2:10pm UTC](https://community.hivemq.com/t/problem-with-websockets/186/3 "2020-03-20T14:10:48Z")

</div>

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
