We developed a web application that communicates with a printer connected to the same LAN, by sending it POST requests.
Such printer has a server open on port 80 that takes XML containing the commands.
It's not possible to communicate with network devices from a page loaded via HTTPS; as such we used a workaround to keep communicating with it: We open a plain http:// popup and use it as a proxy (using postMessage) to send requests on the page's behalf, effectively functioning as a proxy.
This solution currently works on Firefox, but stopped working on the latest Chrome versions (>91?).
By "stopped working" I mean that the requests error out with net::ERR_FAILED
, this only happens on some devices - for example, my Ubuntu machine running Chrome 94.
We could develop a desktop or mobile application merely to serve as a proxy with the printer or distribute the web app itself as an Electron application with CORS disabled, but both solutions sound downright awful and bloated for the end user compared to something that "just works" on every single device with a browser installed.
In summary, what is the proper way, in 2021, to communicate with network devices that don't support HTTPS from an HTTPS page?