Skip to content

Support socks5 proxy - #11085

Merged
codelipenghui merged 9 commits into
apache:masterfrom
Technoboy-:socks5-support
Jul 1, 2021
Merged

Support socks5 proxy#11085
codelipenghui merged 9 commits into
apache:masterfrom
Technoboy-:socks5-support

Conversation

@Technoboy-

@Technoboy- Technoboy- commented Jun 25, 2021

Copy link
Copy Markdown
Contributor

Motivation

Some user networks may have a layer of socks5 proxy, so the client side is added socks5 proxy handler to support socks5 protocal.

Modifications

Add Socks5ProxyHandler in ConnectionPool as the first handler for producer and consumer.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes, add)
  • The public API: (yes)
  • The schema: (no)
  • The default values of configurations: (yes)
  • The wire protocol: (no)
  • The rest endpoints: ( no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)

How to use

      // # 1
      PulsarClient
                .builder()
                .serviceUrl("pulsar://service-url:6650")
                .socks5ProxyAddress(new InetSocketAddress("localhost", 11080)) // change to proxy host and port
                .socks5ProxyUsername("username")  // If there is a username and password
                .socks5ProxyPassword("password")  
                .build()
      
     // # 2
     PulsarClient
                .builder()
                .serviceUrl("pulsar://service-url:6650")
                .build()
     Start client with '-D' like : -Dsocks5Proxy.address=http://localhost:11080 -Dsocks5Proxy.username='username' -DsocksProxy.password='password'

@Anonymitaet Anonymitaet added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Jun 25, 2021
@codelipenghui codelipenghui added doc-required Your PR changes impact docs and you will update later. and removed doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. labels Jun 26, 2021
@codelipenghui codelipenghui added this to the 2.9.0 milestone Jun 26, 2021
@Technoboy- Technoboy- changed the title [WIP] Support socks5 proxy Support socks5 proxy Jun 27, 2021
@Anonymitaet

Anonymitaet commented Jun 28, 2021

Copy link
Copy Markdown
Member

@Technoboy- many thanks for your details!

As we called just now, could you please help add docs and ping me review?

You might need to:

  1. Check to which versions the doc will be added.
  • If you want to modify master doc, go here.
  • If you want to modify versioned docs, go here.
  1. Add docs (3 parameters and add necessary descipritons) here
    image

  2. Besides, this is the doc architecture for various clients, you can take it as a refernece.


Tip

Java Client API website (doc) is automatically generated from its code.

If you add descriptions (like you did here ), you've already added docs for the Java API website. (@codelipenghui so do not remove the component/documentation label from this PR, I've labeled it back. Anyway many thanks for your label :-D)

image

@Anonymitaet Anonymitaet added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Jun 28, 2021
@Technoboy-

Copy link
Copy Markdown
Contributor Author

@Technoboy- many thanks for your details!

As we called just now, could you please help add docs and ping me review?

You might need to:

  1. Check to which versions the doc will be added.
  • If you want to modify master doc, go here.
  • If you want to modify versioned docs, go here.
  1. Add docs (3 parameters and add necessary descipritons) here
    image
  2. Besides, this is the doc architecture for various clients, you can take it as a refernece.

Tip

Java Client API website (doc) is automatically generated from its code.

If you add descriptions (like you did here ), you've already added docs for the Java API website. (@codelipenghui so do not remove the component/documentation label from this PR, I've labeled it back. Anyway many thanks for your label :-D)

image

Done, please help check client-libraries-java.md .

Comment thread site2/website/versioned_docs/version-2.8.1/client-libraries-java.md Outdated
Comment thread site2/website/versioned_docs/version-2.8.1/client-libraries-java.md Outdated

@Anonymitaet Anonymitaet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved from doc perspective

@Anonymitaet Anonymitaet removed the doc-required Your PR changes impact docs and you will update later. label Jun 28, 2021

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

Great Job @Technoboy- , I just left some comments about the tests.

@codelipenghui

Copy link
Copy Markdown
Contributor

@Anonymitaet I noticed you have added the component/documentation tag, we are using this for indicating the PR is only the documentation change? or the PR has documentation change?

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

Great work! Left some comments.

Could you check the code format? Such as the class Socks5Server.

Comment thread site2/docs/client-libraries-java.md
Comment thread site2/website/versioned_docs/version-2.8.1/client-libraries-java.md

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

LGTM

@codelipenghui

Copy link
Copy Markdown
Contributor

/pulsarbot run-failure-checks

@codelipenghui

Copy link
Copy Markdown
Contributor

@Technoboy- Looks the failed the tests are related to this change, PTAL.

@Technoboy-

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui
codelipenghui merged commit 86b8bde into apache:master Jul 1, 2021
codelipenghui pushed a commit to streamnative/pulsar-archived that referenced this pull request Jul 1, 2021
Some user networks may have a layer of socks5 proxy, so the client side is added socks5 proxy handler to support socks5 protocal.

Add Socks5ProxyHandler in ConnectionPool as the first handler for producer and consumer.

(cherry picked from commit 86b8bde)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
### Motivation

Some user networks may have a layer of socks5 proxy, so the client side is added socks5 proxy handler to support socks5 protocal.

### Modifications

Add Socks5ProxyHandler in ConnectionPool as the first handler for producer and consumer.
@Technoboy-
Technoboy- deleted the socks5-support branch August 10, 2022 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants