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

[Bug]: Broker URL path is dropped in connect(), connections fail #1873

Closed
dmotz opened this issue May 23, 2024 · 3 comments · Fixed by #1874
Closed

[Bug]: Broker URL path is dropped in connect(), connections fail #1873

dmotz opened this issue May 23, 2024 · 3 comments · Fixed by #1874
Labels

Comments

@dmotz
Copy link

dmotz commented May 23, 2024

MQTTjs Version

5.6.0

Broker

Eclipse, Hive, MQTTHQ, EMQX

Environment

Browser

Description

A release after 5.3.5 strips paths from broker URLs.

For example, the /mqtt in these broker URLs is dropped and the socket connection is made to the root path /:
wss://mqtt.eclipseprojects.io/mqtt
wss://broker.emqx.io:8084/mqtt
wss://broker.hivemq.com:8884/mqtt
wss://public.mqtthq.com:8084/mqtt

These connections fail as the path is needed.

Minimal Reproduction

mqtt.connect(url) where url contains a path, e.g.:

wss://mqtt.eclipseprojects.io/mqtt
wss://broker.emqx.io:8084/mqtt
wss://broker.hivemq.com:8884/mqtt
wss://public.mqtthq.com:8084/mqtt

Debug logs

mqtt.esm.js:5 WebSocket connection to 'wss://mqtt.eclipseprojects.io/' failed

@dmotz dmotz added the bug label May 23, 2024
@erich2s
Copy link

erich2s commented May 24, 2024

Same here, and I downgraded to 5.5.5, works fine

@robertsLando
Copy link
Member

robertsLando commented May 24, 2024

I have submitted a PR to fix the issue but there is a discussion going on about this if you would like to join so we find a definitive solution to the issue

@robertsLando
Copy link
Member

5.7.0 should fix the issue

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

Successfully merging a pull request may close this issue.

3 participants