# MQTT CLI configuration for websocket

**URL:** <https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214>\
**Category:** MQTT CLI\
**Created:** [April 27, 2020, 3:16pm UTC](https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214 "2020-04-27T15:16:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![almalb](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@almalb](https://community.hivemq.com/u/almalb)\
**Post date:** [April 27, 2020, 3:16pm UTC](https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214/1 "2020-04-27T15:16:36Z")

</div>

Hello,

Trying to connect to “[broker.mqttdashboard.com](http://broker.mqttdashboard.com)” using port 8000 from MQTT CLI i have the output “Server closed connection without DISCONNECT.” What should be the configuration in config.properties file to connect  
NB: I don t have the same issue when i use “[broker.hivemq.com](http://broker.hivemq.com)” on port 1883

---

<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:** [April 28, 2020, 12:08am UTC](https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214/2 "2020-04-28T00:08:55Z")

</div>

Hi @almalb,

You need to use the `-ws` flag, when connecting to the websocket listener.  
Like this:

`mqtt sh`  
`con -ws -h broker.hivemq.com -p 8000 -i clientID`

Kind regards,  
Florian

---

<div class="post-metadata">

**Author:** ![almalb](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@almalb](https://community.hivemq.com/u/almalb)\
**Post date:** [April 28, 2020, 11:45pm UTC](https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214/3 "2020-04-28T23:45:25Z")

</div>

Hi,

Thank you for your answer, after using the suggested command i receive the error : Unknown option: ‘-ws’.  
Thanks in advance

---

<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:** [April 28, 2020, 11:57pm UTC](https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214/4 "2020-04-28T23:57:00Z")

</div>

Which version of the CLI are you using?  
It works fine for me.

 ![Screenshot 2020-04-28 at 19.55.55](https://canada1.discourse-cdn.com/flex035/uploads/hivemq1/original/1X/c7f45b25ec9777d3ec3c9b646bb9baf96af5c36b.png)  
Please note that I went to shell mode first in my example above by typing `mqtt sh`

---

<div class="post-metadata">

**Author:** ![almalb](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@almalb](https://community.hivemq.com/u/almalb)\
**Post date:** [May 1, 2020, 11:01am UTC](https://community.hivemq.com/t/mqtt-cli-configuration-for-websocket/214/5 "2020-05-01T11:01:26Z")

</div>

It worked after changing the mqtt-cli version. Than you,
