Skip to content

Add JVM SOCKS5 proxy support to NettyConnectionClient#16285

Open
zrlw wants to merge 2 commits into
apache:3.3from
zrlw:3.3-socks5-proxy
Open

Add JVM SOCKS5 proxy support to NettyConnectionClient#16285
zrlw wants to merge 2 commits into
apache:3.3from
zrlw:3.3-socks5-proxy

Conversation

@zrlw

@zrlw zrlw commented May 19, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

try to fix #16276

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter

codecov-commenter commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.81%. Comparing base (c3ceb27) to head (59c4488).

Files with missing lines Patch % Lines
...e/dubbo/remoting/transport/netty4/NettyClient.java 93.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16285      +/-   ##
============================================
+ Coverage     60.79%   60.81%   +0.01%     
+ Complexity    11777    11775       -2     
============================================
  Files          1953     1953              
  Lines         89208    89214       +6     
  Branches      13458    13458              
============================================
+ Hits          54234    54254      +20     
+ Misses        29403    29395       -8     
+ Partials       5571     5565       -6     
Flag Coverage Δ
integration-tests-java21 32.17% <65.00%> (+0.04%) ⬆️
integration-tests-java8 32.23% <65.00%> (-0.09%) ⬇️
samples-tests-java21 32.21% <65.00%> (+0.08%) ⬆️
samples-tests-java8 29.86% <65.00%> (+<0.01%) ⬆️
unit-tests-java11 59.07% <95.00%> (+0.04%) ⬆️
unit-tests-java17 58.50% <95.00%> (-0.02%) ⬇️
unit-tests-java21 58.53% <95.00%> (+0.02%) ⬆️
unit-tests-java25 58.49% <95.00%> (+0.01%) ⬆️
unit-tests-java8 59.07% <95.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds SOCKS5 proxy support to the tri/HTTP2 Netty client path by wiring Netty’s Socks5ProxyHandler into NettyConnectionClient when JVM-style proxy properties are present, addressing #16276.

Changes:

  • Read socksProxyHost / socksProxyPort from Dubbo’s global configuration (incl. system properties) and conditionally add Socks5ProxyHandler to the Netty pipeline.
  • Skip proxying for local/loopback targets via a new isFilteredAddress(...) helper.
  • Add supporting imports/constants for the new behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RainYuY

RainYuY commented May 29, 2026

Copy link
Copy Markdown
Member

@zrlw Let's handle the Copilot prompt first, either reject or accept is fine

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java:63

  • NettyClient.SOCKS_PROXY_HOST/PORT/DEFAULT_SOCKS_PROXY_PORT are declared private in NettyClient, so referencing them here will not compile. Define these keys locally (or make them accessible via a public/package-private constant in another change).

public final class NettyConnectionClient extends AbstractNettyConnectionClient {

    private Bootstrap bootstrap;

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

…ttyClient to reduce NumberFormatException probability during parsing socksProxyPort
@zrlw zrlw force-pushed the 3.3-socks5-proxy branch from 5f88d36 to 8854381 Compare June 9, 2026 03:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support SOCKS5 proxy for tri protocol in NettyConnectionClient

6 participants