Vignesh S
1 min readApr 25, 2019

Can you please suggest why am getting this error when try to connect my react app to mosquitto Server?

error: WebSocket connection to ‘ws://test.mosquitto.org/’ failed: Error during WebSocket handshake: Unexpected response code: 200

const client = mqtt.connect(‘mqtt://test.mosquitto.org’)

“tcp://localhost:1883” (local connection established via backend(for publishing), frontend(ReactApp) has to subscribe and facing the connection issue with the above error.

library installed (npm i mqtt)

Vignesh S
Vignesh S

No responses yet

Write a response