Skip to content

[8.7.0] (feat): Add SOCKS proxy (https://github.com/bazelbuild/bazel/pull/29274)#29302

Closed
bazel-io wants to merge 1 commit intobazelbuild:release-8.7.0from
bazel-io:cp29274-8.7.0-051706
Closed

[8.7.0] (feat): Add SOCKS proxy (https://github.com/bazelbuild/bazel/pull/29274)#29302
bazel-io wants to merge 1 commit intobazelbuild:release-8.7.0from
bazel-io:cp29274-8.7.0-051706

Conversation

@bazel-io
Copy link
Copy Markdown
Member

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 #23617

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • 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 #29274.

PiperOrigin-RevId: 899472208
Change-Id: Ic6f41a36bd889f9ddabb08336fafa767f96b54f6

Commit 59e9bf5

  ### 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
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Apr 15, 2026
@bazel-io bazel-io requested a review from a team as a code owner April 15, 2026 05:17
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Apr 15, 2026
@bazel-io bazel-io requested review from fmeum and meteorcloudy April 15, 2026 05:17
@meteorcloudy
Copy link
Copy Markdown
Member

@ssarad Can you please help fix the broken test?

@ssarad
Copy link
Copy Markdown
Contributor

ssarad commented Apr 15, 2026

@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 import java.net.URI; but since it already exists in my branch, I think it might be easier to make a PR against the fork's branch and merge that, or do you recommend something else?

@meteorcloudy
Copy link
Copy Markdown
Member

@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.

@ssarad
Copy link
Copy Markdown
Contributor

ssarad commented Apr 15, 2026

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.

@iancha1992 iancha1992 closed this Apr 15, 2026
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants