feat: add reusable proxy configuration

This commit is contained in:
QiuSW
2026-07-25 17:04:26 +08:00
parent f13e06500c
commit 3a3c92c875
13 changed files with 772 additions and 48 deletions
+17
View File
@@ -63,3 +63,20 @@ func TestLaunchSpecNormalizeRejectsInvalidRemoteDebugPort(t *testing.T) {
}
}
}
func TestNormalizeProxyServerCanonicalizesAndRejectsCredentials(t *testing.T) {
got, err := NormalizeProxyServer(" HTTPS://Proxy.Local:8443 ")
if err != nil || got != "https://proxy.local:8443" {
t.Fatalf("NormalizeProxyServer() = %q, %v", got, err)
}
for _, value := range []string{
"http://user:secret@127.0.0.1:8080",
"http://127.0.0.1:8080/path",
"ftp://127.0.0.1:21",
"socks5://127.0.0.1:70000",
} {
if _, err := NormalizeProxyServer(value); !errors.Is(err, ErrInvalidLaunchSpec) {
t.Errorf("NormalizeProxyServer(%q) error = %v", value, err)
}
}
}