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
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!
Most helpful comment
Could you please try
instead of
It should bind to all interfaces by default.