This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 2-https-proxy.lua | |
| -- KOReader userpatch: enable HTTPS requests through an HTTP CONNECT proxy. | |
| -- | |
| -- Stock LuaSec (ssl.https) refuses to use a proxy for HTTPS ("proxy not | |
| -- supported"). This is a problem when reaching tailnet services via a | |
| -- userspace Tailscale HTTP-CONNECT proxy (e.g. 127.0.0.1:1056) on devices | |
| -- with no TUN module, where DNS for *.ts.net can't be resolved locally. | |
| -- | |
| -- This patch reimplements ssl.https' internal `tcp` connector to open a | |
| -- CONNECT tunnel through the proxy (so the proxy resolves the hostname and |