charts icon indicating copy to clipboard operation
charts copied to clipboard

Enable websocket support for mosquito mqtt

Open dberlin opened this issue 3 years ago • 1 comments

Is your feature request related to a problem?

This is necessary to use web based mqtt clients against the broker. it just is compiled without websocket support by default. Turning on the with_websocket option during compile should fix it. It then just needs the ability to add More than one listener port to the config.

(Websocket config is identical to normal config it just has an additional "protocol websocket"after the listener port)

Describe the solution you'd like

Compilation with websocket support

Describe alternatives you've considered

Truecharts doesn't have other brokers and this should be really easy to fix

Additional context

No response

I've read and agree with the following

  • [X] I've checked all open and closed issues and my request is not there.
  • [X] I've checked all open and closed pull requests and my request is not there.

dberlin avatar Sep 17 '22 21:09 dberlin

and note that the eclipse-mosquitto official published docker images have websocket support compiled in if you need an image source.

dberlin avatar Sep 18 '22 01:09 dberlin

I have confirmed the docker image being used in this chart already supports websockets (it is compiled in, but not configured). The only thing that is required to enable it, is adding the following config to either /mosquitto/config/mosquitto.conf or in a new file /mosquitto/configinc/websockets.conf:

listener 9001
protocol websockets

After restarting the app, if you shell in an run netstat -l you will see mosquitto listening on the additional port 8083:

/ $ netstat -ltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      1/mosquitto
tcp        0      0 :::9001                 :::*                    LISTEN      1/mosquitto
tcp        0      0 :::1883                 :::*                    LISTEN      1/mosquitto

The next step would be to expose this as an additional service to the outside world in the chart.

woodsb02 avatar Sep 25 '22 02:09 woodsb02

Interesting - i swear i actually tried this, and kept getting told on startup that it did not support websockets. I'll give it another try.

dberlin avatar Sep 25 '22 02:09 dberlin

This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists

truecharts-admin avatar Feb 03 '23 13:02 truecharts-admin