MQTT.js icon indicating copy to clipboard operation
MQTT.js copied to clipboard

Cannot connect from browser to native MQTT

Open PaulCorbeau opened this issue 5 years ago • 2 comments

Hello,

I try to access directly a MQTT broker on port 1883, without websocket from a browser.

image

When I check the object result I can see that the protocol is not changed to mqtt nor tcp :

image

I found that some settings can be change with the option : wsOptions. I tried to create manually the Websocket but it indicates that it accepts only ws or wss.

Am I missing something ?

thanks

AB#8978851

PaulCorbeau avatar Dec 15 '20 10:12 PaulCorbeau

Port 1883 is for MQTT protocol, which is different to MQTT over Websockets. Your broker needs to support MQTT over websockets, and this will usually be running on a different port, maybe 80, 8080, 8883 (I don't believe there is a 'default' universally used like 1883 is for MQTT). Basically MQTT.js through a brower only supports "MQTT over websockets" and not 'native' MQTT protocol.

sectokia avatar Dec 19 '20 04:12 sectokia

This is an automated message to let you know that this issue has gone 365 days without any activity. In order to ensure that we work on issues that still matter, this issue will be closed in 14 days.

If this issue is still important, you can simply comment with a "bump" to keep it open.

Thank you for your contribution.

github-actions[bot] avatar Sep 21 '22 02:09 github-actions[bot]

This issue was automatically closed due to inactivity.

github-actions[bot] avatar Oct 17 '22 02:10 github-actions[bot]