Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websockets - bind address/host in listener doesn't work for websockets protocol #3045

Open
dchabrzyk opened this issue Apr 23, 2024 · 3 comments

Comments

@dchabrzyk
Copy link

  1. Tested on RaspberryPi, Mosquitto version 2.0.11

  2. Application doesn't respect the bind address/host option for listener parameter when using websockets protocol. After changing protocol to MQTT everything works fine.

  3. Tested configuration entry
    listener 9001 127.0.0.1
    protocol websockets

  4. netstat output
    masta@rpi-masta:/etc/mosquitto $ sudo netstat -tulnp | grep mosquitto
    tcp 0 0 127.0.0.1:1883 0.0.0.0:* LISTEN 3583/mosquitto
    tcp6 0 0 :::9001 :::* LISTEN 3583/mosquitto

@Daedaluz
Copy link
Contributor

is that the whole configuration?

listener 9001 127.0.0.1
protocol websockets

@Daedaluz
Copy link
Contributor

running this tiny config in a container for 2.0.11 has the same issue. 2.0.12 does not.
not sure if this is a libwebsockets or mosquitto issue, but you could try go up a few mosquitto versions too.

@t-stamm
Copy link

t-stamm commented Jun 18, 2024

I'm facing a similar issue except that I am using 2.0.18.

config is:
`allow_anonymous true
listener 1883
protocol mqtt

listener 1884
protocol websockets`

netstat shows successful connections on 1883 but nothing even listening on 1884, even though the log during starting states

Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: mosquitto version 2.0.18 starting
Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: Config loaded from /etc/mosquitto/mosquitto.conf.
Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: Opening ipv4 listen socket on port 1883.
Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: Opening ipv6 listen socket on port 1883.
Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: Warning: Address family not supported by protocol
Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: Opening websockets listen socket on port 1884.
Jun 18 15:14:31 servername mosquitto[253693]: 1718723671: mosquitto version 2.0.18 running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants