MQTT CLI configuration for websocket


Trying to connect to “” using port 8000 from MQTT CLI i have the output “Server closed connection without DISCONNECT.” What should be the configuration in file to connect
NB: I don t have the same issue when i use “” on port 1883

Hi @almalb,

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

mqtt sh
con -ws -h -p 8000 -i clientID

Kind regards,


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

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

Please note that I went to shell mode first in my example above by typing mqtt sh

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