krylovsk / mqtt-benchmark

MQTT broker benchmarking tool
Apache License 2.0
299 stars 80 forks source link

How to make a websocket test? #11

Open liufanghua2012 opened 4 years ago

liufanghua2012 commented 4 years ago

i tried to modify the following cmd: mqtt-benchmark --broker tcp://myhost:1883 --count 100 --size 100 --clients 100 --qos 2 --format text

to: mqtt-benchmark --broker ws://myhost:8083 --count 100 --size 100 --clients 100 --qos 2 --format text

but got errors like: 2020/08/09 02:13:35 Starting client 95 2020/08/09 02:13:35 Starting client 96 2020/08/09 02:13:35 Starting client 97 2020/08/09 02:13:35 Starting client 98 2020/08/09 02:13:35 Starting client 99 2020/08/09 02:13:36 CLIENT 48 had error connecting to the broker: Network Error : websocket: bad handshake 2020/08/09 02:13:36 CLIENT 55 had error connecting to the broker: Network Error : websocket: bad handshake 2020/08/09 02:13:36 CLIENT 98 had error connecting to the broker: Network Error : websocket: bad handshake 2020/08/09 02:13:36 CLIENT 30 had error connecting to the broker: Network Error : websocket: bad handshake 2020/08/09 02:13:36 CLIENT 31 had error connecting to the broker: Network Error : websocket: bad handshake 2020/08/09 02:13:36 CLIENT 72 had error connecting to the broker: Network Error : websocket: bad handshake ......

so, i was wondering hot to make a successful websocket test?

krylovsk commented 4 years ago

Unfortunately the tool doesn't support WebSocket connection. Maybe you would be willing to investigate it and prepare a PR?

YarekTyshchenko commented 2 years ago

--broker ws://myhost/foo. Also works with wss for websockets over TLS

sreekesh93 commented 2 years ago

@krylovsk If this works, can we close this ticket @liufanghua2012 ?

sreekesh93 commented 2 years ago

any updates on the state?