[8.7.0] (feat): Add SOCKS proxy (https://github.com/bazelbuild/bazel/pull/29274)#29302
[8.7.0] (feat): Add SOCKS proxy (https://github.com/bazelbuild/bazel/pull/29274)#29302bazel-io wants to merge 1 commit intobazelbuild:release-8.7.0from
Conversation
### Description `ProxyHelper.java` only supported HTTP/HTTPS proxies, rejecting SOCKS proxy URLs with the error "Proxy address socks5://... is not a valid URL". This change adds support for `socks://`, `socks4://`, and `socks5://` proxy schemes. Changes: - Updated URL validation regex to accept SOCKS proxy schemes - Added logic to create `Proxy.Type.SOCKS` when SOCKS schemes are detected - Set default port to 1080 for SOCKS proxies (standard SOCKS port) - Added tests for SOCKS proxy functionality ### Motivation Fixes bazelbuild#23617 ### Build API Changes No ### Checklist - [x] I have added tests for the new use cases (if any). - [x] I have updated the documentation (if applicable). ### Release Notes RELNOTES[NEW]: Added SOCKS proxy support. Bazel now accepts `socks://`, `socks4://`, and `socks5://` URLs in `HTTPS_PROXY`/`HTTP_PROXY` environment variables and related system properties. Closes bazelbuild#29274. PiperOrigin-RevId: 899472208 Change-Id: Ic6f41a36bd889f9ddabb08336fafa767f96b54f6
|
@ssarad Can you please help fix the broken test? |
|
@meteorcloudy It looks like its failing because in the fork, it's missing the import https://github.com/bazel-io/bazel/blob/ffda129f08d875c9c2391e7c9f24d67db687593e/src/test/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelperTest.java#L24 which exists in my PR because it was upto-date with master in bazelbuild/bazel. That should be changed to |
|
@ssarad Can you please prepare a PR for release-8.7.0 directly based on the current one? I can approve that. The current fork is created by a bot, so not so easy to merge a PR. |
|
I've opened a new PR for release-8.7.0 and I've tagged you there. We can close this one once that is approved. |
Description
ProxyHelper.javaonly supported HTTP/HTTPS proxies, rejecting SOCKS proxy URLs with the error "Proxy address socks5://... is not a valid URL". This change adds support forsocks://,socks4://, andsocks5://proxy schemes.Changes:
Proxy.Type.SOCKSwhen SOCKS schemes are detectedMotivation
Fixes #23617
Build API Changes
No
Checklist
Release Notes
RELNOTES[NEW]: Added SOCKS proxy support. Bazel now accepts
socks://,socks4://, andsocks5://URLs inHTTPS_PROXY/HTTP_PROXYenvironment variables and related system properties.Closes #29274.
PiperOrigin-RevId: 899472208
Change-Id: Ic6f41a36bd889f9ddabb08336fafa767f96b54f6
Commit 59e9bf5