Search code examples
javascriptwindowswebsocketmqttmosquitto

mosquitto 1.4.14 not supporting web socket in windows and code is not working


I am working mqtt and i made a webscript and i want to use it with mosquiito 1.4.14, but its not working with web socket support, I tried to put WEBSOCKET and port number in mosquitto.conf file but its still not working..

I had error WebSocket connection to 'ws://localhost:1883/mqtt' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED...

I checked my code by replacing the online broker address and port number it`s working... so where to find the web socket support broker or how to make mosquitto to work with web socket


Solution

  • The pre-built versions of mosquitto for Windows available for download from the mosquitto website do NOT include websocket support.

    The only way to get websocket support on Windows with mosquitto is to build it yourself as described in this Internet of Things Stack Exchange post:

    https://iot.stackexchange.com/questions/1205/how-to-enable-websockets-on-mosquitto-running-on-windows/