feat(webclient): enable proxying of HTTPS requests over HTTP
- Trim ":443" from addresses to handle secure connections - Force URL scheme to "http" for downstream requests - Update WASM binary accordingly This allows the web proxy to route HTTPS traffic through the HTTP-based tunnel.
lemon-mint committed
Oct 30, 2025 at 23:42 UTC
6f599b4d3148e9a427e4335640b98732e27dc9cf
2 files changed
+2
cmd/webclient/main.wasm
Binary files a/cmd/webclient/main.wasm and b/cmd/webclient/main.wasm differ
cmd/webclient/main_js.go
+2
@@ -30,6 +30,7 @@ var client = &http.Client{
30
MaxIdleConnsPerHost: 100,
31
DialContext: func(ctx context.Context, network, address string) (net.Conn, error) {
32
address = strings.TrimSuffix(address, ":80")
33
+ address = strings.TrimSuffix(address, ":443")
34
cred := sdk.NewCredential()
35
conn, err := rdClient.Dial(cred, address, "http/1.1")
36
if err != nil {
@@ -56,6 +57,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
57
58
r = r.Clone(context.Background())
59
r.URL.Host = id
60
+ r.URL.Scheme = "http"
61
62
resp, err := client.Do(r)
63
if err != nil {