paho.mqtt.javascript icon indicating copy to clipboard operation
paho.mqtt.javascript copied to clipboard

wss connection interrupted error in firefox, works in chrome

Open lordmundi opened this issue 5 years ago • 5 comments

I'm using the latest paho-mqtt.js from master and i'm testing it against the server at test.mosquitto.org on port 8081. In chrome, everything works fine, but in firefox I get:

The connection to wss://test.mosquitto.org:8081/mqtt was interrupted while the page was loading.

I've tried putting the connection kickoff at window onload instead of via a connect button, but got the same error in firefox.

Curiously, if I change to an http server instead of https and change the code to not use "useSSL" in the connect options (along with switching to port 8080), then everything works fine in firefox. It is only when https / wss is being used that I keep getting this error and can't get any connect / subscription to work in firefox.

This is using Firefox 78.4.1esr (32-bit)

lordmundi avatar Nov 12 '20 18:11 lordmundi

I have the exact same issue. You can work around it by setting: "network.http.spdy.websockets" to FALSE in about:config.

But it should probably be fixed.

jonjonarnearne avatar Jan 05 '21 11:01 jonjonarnearne

This seems to be an issue with the mosquitto/libwebsockets

https://github.com/eclipse/mosquitto/issues/1211

jonjonarnearne avatar Jan 05 '21 14:01 jonjonarnearne

any updates to this, I also was able to fix in firefox by setting "network.http.spdy.websockets" to FALSE in about:config. I saw Roger, one of the mosquitto maintainers, plans on moving away from libwebsockets.

However, another fix is to remake libwebsockets but without http2 support. I have yet to do this however, and have never built a dependency from source so it should be interesting haha.

mike-sandstrom avatar Jun 03 '21 19:06 mike-sandstrom

Fast forward a year later... any news on this? The issue apparently still persists. I can't rely on users changing their config settings 😅 What did you guys do to resolve the issue?

tombjarne avatar Sep 17 '22 09:09 tombjarne

I resolved it as posted here: https://github.com/eclipse/mosquitto/issues/1211#issuecomment-958137569

Thus, by installing a libwebsockets version compiled with http2 support disabled.

romor avatar Sep 21 '22 17:09 romor