Closed blazoncek closed 1 year ago
So if you compile without there is an alternative implementation already? Long polling? If you make the appropriate non-ws call to a WS enabled build does it work? I.e is it just the front-end code that would need to change?
Both will need an update. And yes, if you disable websockets, peek works without.
Not sure how to best detect the failure, I've seen poorly written firewalls allow the websocket to be negotiated, but then block any actual messages, so protocol switch is not always enough to prove success
IMO fairly easy. When WS is not established or times out fallback to HTTP. Easy in GUI more work in backend.
My point is that sometimes it can report as established, but isn't really, so would require timeout for an actual message, not just the http and protocol switch.
Failure to support protocol switch is much easier and to be fair more likely to happen, especially if folk are trying to reverse proxy and don't know how to do correctly
Thanks for clarification.
If you are willing to help, the backend code is #ifdef-ed in wled_server.cpp
and frontend happens in index.js
. Search for "liveview".
Partially solved by https://github.com/Aircoookie/WLED/commit/f015227fc8aa34cd511d8b1c9d91cd0a5c5c9067 Still missing 2D peek.
I have asked @ewoudwijma to look into implementing 2D peek using HTTP JSON requests.
Not going to pursue this any further.
What happened?
If WLED is compiled with Websockets the Peek LED output preview fails to load if websocket connection can't be established for some reason (proxy, firewall, etc). It should gracefully fall-back to non Websocket implementation instead.
To Reproduce Bug
Add a firewall or a reverse proxy which will block websockets between WLED and client.
Expected Behavior
Peek should work with or without Websockes, regardless of the way how WLED was compiled (with or without Websockets).
Install Method
Self-Compiled
What version of WLED?
0.14.0-b3 2206130
Which microcontroller/board are you seeing the problem on?
ESP8266, ESP32, ESP32-S2, ESP32-C3
Relevant log/trace output
Anything else?
No response
Code of Conduct