HTTPS And Mesh
The PC printer driver can expose HTTPS through Caddy and PeerJS signaling through/mesh.
HTTPS Conditions
HTTPS starts only when all of these are true:features.httpsEnabledistrue.caddy.enabledistrue.- The runtime platform is Windows.
- Certificates exist in
assets/certs. - Caddy can be installed or reused.
Certificate Files
Required files:Caddy Install
Caddy setup uses this order:- Reuse
assets/caddy/bin/caddy.exeif already installed with.installed. - Copy bundled
caddy.exefrom known local paths. - Download Caddy from GitHub release URL.
2.6.4.
Generated Caddyfile
The driver writes a Caddyfile like:caddy.httpsPort is not 443, the site address includes the port.
Caddy Runtime
Caddy runs as a child process with:XDG_DATA_HOMEset toassets/caddy/dataXDG_CONFIG_HOMEset toassets/caddy/config- working directory set to
assets/caddy
2000ms delay.
Mesh Signaling
Whenfeatures.meshEnabled is true, the driver mounts PeerJS at:
GET /mesh-status returns:
- whether mesh is enabled
- mesh path
- port
- connected peer IDs
- peer count
Common HTTPS Problems
| Symptom | Likely Cause | Fix |
|---|---|---|
| Browser blocks HTTPS driver URL | CA certificate not trusted | Install ca.crt on the POS device. |
https://plato-printer.local does not resolve | DNS/hosts missing | Add local DNS or hosts entry to driver IP. |
| Port 443 unavailable | Another service is using it | Stop the other service or change caddy.httpsPort. |
| HTTPS skipped on macOS/Linux | Code is Windows-only | Use HTTP in development or test Caddy separately. |
| Windows 7 startup error | Caddy version not 2.6.4 | Set caddy.version back to 2.6.4. |