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]: Unable to connect to broker via mqtt protocol #1950

Open
yellsri-bh opened this issue Oct 21, 2024 · 1 comment
Open

[Bug]: Unable to connect to broker via mqtt protocol #1950

yellsri-bh opened this issue Oct 21, 2024 · 1 comment
Labels

Comments

@yellsri-bh
Copy link

yellsri-bh commented Oct 21, 2024

MQTTjs Version

^5.10.1

Broker

test.mosquitto.org

Environment

NodeJS

Description

I have broker with mqtt and ws protocol, tyring to connect from React vite App.

  1. Tried to connect to broker via mqtt protocol, its not getting connected but working with ws protocol
  2. If mqtt:// is specified in the brokerUrl, internally replacing to ws://.

Does this package support to connect to broker via mqtt protocol ?

Minimal Reproduction

Connect to mqtt://test.mosquitto.org:1883 using mqtt.connect(...) function

It is sometimes taking long time to connect or else it shows failed to connect to url : ws://test.mosquitto.org:1883
It is replacing the protocol, even If I mention the defaultProtocol and protocol as mqtt

Unable to get the logs (using vite so it didn't load the application correctly).

Debug logs

<UNABLE_TO_GET_LOGS>

@yellsri-bh yellsri-bh added the bug label Oct 21, 2024
@robertsLando
Copy link
Member

I have a feel your env is browser, not nodejs and browser only supports ws/wss protocol

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

No branches or pull requests

2 participants