Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gh-2406] support rpc requests via proxies. #2462

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

feliciss
Copy link
Collaborator

@feliciss feliciss commented Aug 18, 2024

Summary

Copy link

vercel bot commented Aug 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 2, 2024 0:34am
rooch-portal-v2.1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 2, 2024 0:34am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Sep 2, 2024 0:34am

Comment on lines 69 to 71
http: http_client.clone(),
rooch: RoochRpcClient::new(http_client.clone()),
reqwest: reqwest_client,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should find method to add proxy to HTTP client and replace the HTTP client in RoochRpcClient, not add a new client.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should find method to add proxy to HTTP client and replace the HTTP client in RoochRpcClient, not add a new client.

From my research, the HTTP client doesn't support proxied request. However, I'll find a way to add a proxy to the http client.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From what I could find so far, the JsonRpsee lib only supports socks5 proxy, meaning that there's no way to connect with https_proxy or all_proxy through using only the JsonRpsee lib. I'm sorry for that.

  1. https://grants.web3.foundation/docs/RFPs/jsonrpsee-proxy-support
  2. Proxy websocket connections through socks proxy paritytech/jsonrpsee#870
  3. refactor: update and turn WsTransportClientBuilder generic paritytech/jsonrpsee#1168

@@ -18,14 +18,23 @@ pub struct AddCommand {
pub rpc: String,
#[clap(long, value_hint = ValueHint::Url)]
pub ws: Option<String>,
#[clap(long, value_hint = ValueHint::Url)]
pub proxy: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

The proxy is global, not a configuration option for Rooch Env.

Copy link
Collaborator Author

@feliciss feliciss Aug 25, 2024

Choose a reason for hiding this comment

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

The proxy is global, not a configuration option for Rooch Env.

I think it should and shall be distinguished from the global proxy for each specific application. Global proxy in the system and the proxy in the application are two different elements and they should not be deemed as one.

@feliciss
Copy link
Collaborator Author

feliciss commented Sep 2, 2024

I leave this issue untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CLI] support https_proxy,all_proxy env to request RPC
2 participants