Mosquitto: Websocket connection not working for v1.5.4

Created on 20 Nov 2018  路  10Comments  路  Source: eclipse/mosquitto

Mqtt Configuration:
port 1883
protocol mqtt

listener 9001 0.0.0.0
protocol websockets

log_type all
websockets_log_level 255


Error in cmd:
C:\Program Files (x86)\mosquitto>mosquitto.exe -v -c mosquitto.conf
1542703760: mosquitto version 1.5.4 starting
1542703760: Config loaded from mosquitto.conf.
1542703760: Opening websockets listen socket on port 9001.
1542703760: libuv support not compiled in
1542703760: Creating Vhost 'default' port 9001, 3 protocols, IPv6 on
1542703760: Using non-SSL mode
1542703760: WSAAddressToString() : 10022
1542703760: ERROR on binding fd 296 to port 9001 (-1 10048)
1542703760: init server failed
1542703760: Failed to create default vhost
1542703760: Error: Unable to create websockets listener on port 9001.

OS: Windows server 2016

Most helpful comment

Could you please try

listener 9001

instead of

listener 9001 0.0.0.0

It should bind to all interfaces by default.

All 10 comments

Could you please try

listener 9001

instead of

listener 9001 0.0.0.0

It should bind to all interfaces by default.

@ralight : I'm getting Same error after changing to "listener 9001"

Error 10048 is WSAEADDRINUSE, are there any other programs already listening on port 9001?

No other application running on 9001 port. Even i changed the port number , it was showing same error.

netstat command for 9001.

netstat -ano|findstr 9001
TCP [::]:9001 [::]:0 LISTENING 3204

Listen only ipv6

Aha! Good find. I think that essentially puts it on the same standing as #1004.

@ralight when i can expect the 1.5.5

1.5.5 will be released in one week.

I believe this should work on the upcoming 1.5.5 if you use:

socket_domain ipv4

in your config file.

This is still a problem with mosquitto 1.5.8, where socket_domain ipv4 is required for all listeners.

Something that had previously worked for me:

listener 9001
protocol websockets

listener 1883 localhost

But now resulted in the aforementioned error:

Error: Unable to create websockets listener on port 9001.

Removing localhost fixed this issue and this thread lead me to that discovery. Thank you smart folks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Andreyooo picture Andreyooo  路  5Comments

Ben-Macri picture Ben-Macri  路  5Comments

korish picture korish  路  7Comments

nwf picture nwf  路  5Comments

smarty70 picture smarty70  路  3Comments