There is a project https://github.com/leon-mbs/pservernode
A server that is accessed by JavaScript from the browser (from the accounting system page)
if it is necessary to print a receipt or print a label on a product, and printing directly from the browser
using the system printer is not suitable in terms of quality
The problem arises if the print server (running where the printer is connected) is accessed from
a browser open on another computer (or tablet via wi-fi) in the network.
If the site from which the print server is accessed is hosted
the CORS issue is compounded by the problem of mixing http and https
It is necessary.
To check that the server works with CORS requests (JavaScript via AJAX and not the address bar or Postman) from another host in the network]
If there are problems – fix them.
To finalize so that the server can work in https mode.
support for both http (main) and https is needed with reconfiguration in the config.
generate an example of an ssl certificate (on IP 127.0.0.1) indicating where to insert it.
Write instructions for creating a self-signed certificate or a link to the instructions
Users of the program are usually NOT IT specialists, they cannot rebuild the program from the sources so it is necessary that
in htpps it can be switched in config.json (or make a separate config type config_ssl.json, let them rename the file)
Nothing needs to be done with the printer - there is a command /check to check the response of the print server
It is preferable that it works on both Windows and Linux, but the priority is Linux