diff options
| author | 胡玮文 <huweiwen.hww@alibaba-inc.com> | 2024-03-08 13:42:49 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-03-11 18:07:37 +0000 |
| commit | c8e4f8c7756d67e27d2cfe4383cb90cf9f97d5a3 (patch) | |
| tree | a0174b0fdb5e34178eb03bd6d60b12aa0bf28e38 /src/net/http/transport_test.go | |
| parent | ec4baaca390ac884c1f55fa1171d2b1eac571b0a (diff) | |
| download | go-c8e4f8c7756d67e27d2cfe4383cb90cf9f97d5a3.tar.xz | |
net/http: support socks5h proxy schema
Extend the net/http Transport to recognize the 'socks5h' schema as an
alias for 'socks5'. Traditionally, the 'socks5h' schema indicates that
the hostname should be resolved by the proxy server, which is behavior
already implemented in Go for 'socks5'.
Fixes #24135
Change-Id: I0a6a92bbd282a3200dc4dc7b47a9b0628f931783
Reviewed-on: https://go-review.googlesource.com/c/go/+/569977
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/net/http/transport_test.go')
| -rw-r--r-- | src/net/http/transport_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index 55222a6763..e407d1768a 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -3282,6 +3282,7 @@ var proxyFromEnvTests = []proxyFromEnvTest{ {env: "http://127.0.0.1:8080", want: "http://127.0.0.1:8080"}, {env: "https://127.0.0.1:8080", want: "https://127.0.0.1:8080"}, {env: "socks5://127.0.0.1", want: "socks5://127.0.0.1"}, + {env: "socks5h://127.0.0.1", want: "socks5h://127.0.0.1"}, // Don't use secure for http {req: "http://insecure.tld/", env: "http.proxy.tld", httpsenv: "secure.proxy.tld", want: "http://http.proxy.tld"}, |
