Blueforcer / awtrix3

Custom firmware for the Ulanzi Smart Pixel clock or self made awtrix. Getting started is easy as 1-2-3
https://blueforcer.github.io/awtrix3/
Other
1.41k stars 112 forks source link

Interface not working using reverse proxy (HTTPS and/or subdirectory) #236

Closed wilfredktlr closed 1 year ago

wilfredktlr commented 1 year ago

Bug report

Describe the bug

I use a reverse proxy (HAProxy) to access the webinterface. When Awtrix want's to load a resource (eg. http://${window.location.hostname}/[filename]) it fails because the browser cannot access it when the webinterface is accessed using HTTPS or a subdirectory. This causes the webinterface to not work correctly (eg. the menu).

Additional information

To Reproduce

Steps to reproduce the behavior:

Expected behavior

No JavaScript errors and a working menu.

Screenshots

An example of a fixed protocol and path.

image

The JavaScript error and non-working menu.

image

Logs

N/A

Additional context

A possible solution would be to make the URL relative (eg. var e=new URL('./config.json');).

Blueforcer commented 1 year ago

This "bug" should belong to the webinterface library. https://github.com/cotestatnt/esp-fs-webserver

My knowlege for that is limited. Feel free to open a PR

wilfredktlr commented 1 year ago

Thanks. I didn't realize that this was an external library. I've opened an issue over there.

wilfredktlr commented 1 year ago

The author of the esp-fs-webserver just fixed the issue in version 1.2.3.

PS. I see the library is included in your source files. I'm a webdevelop and no expert on ESP programming but can't you add you add it to the platformio.ini file (source) so you can easily update to a new version?