eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.14k stars 468 forks source link

connection trouble? #222

Open thelostinthought opened 3 years ago

thelostinthought commented 3 years ago

using "https://www.eclipse.org/paho/clients/js/utility/"

when I try to connect to a local ip and enter port 9001 with tls turned off wireshark shows no activity. with tls turned on wireshark shows activity, but my broker isn't set up for that, so the connection fails.

In firefox I tried to "inspect element" and click the connect button. It paused on paho-mqtt.js line 1054 saying "new websocket" saying "SecurityError: The operation is insecure." I continued the script and noticed it gets stuck in jquery.min.js line 3 at "while(b--)c=e". bouncing between the b and c.

after a "tls on" connection failure, when tls is turned off, id="connectionstatus" is never updated to show any change in status and still says "Failed to connect: AMQJS0007E Socket error:undefined" from when tls was on. wireshark shows a response of 403 forbidden when tls is on so the port is probably technically accessible on the broker with a refused ish connection?

connecting to a known closed port with tls on changes the status to"Failed to connect: AMQJSC0001E Connect timed out." Afterwards connecting to a known closed port with tls off doesn't change status.

I tried this on a second device and it also fails.

my broker was later verified to be working with a different (older?) version of the code.

the code for that page claims this is the github for the project.

thelostinthought commented 3 years ago

good news. it wasn't an issue with my broker. I tried "http://www.hivemq.com/demos/websocket-client/". that's based on the same code, just a different version.