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

client: add support to set https_proxy/no_proxy for client #160

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

Xynnn007
Copy link
Contributor

This feature allows a client to pull images via a proxy. In some cases like intranet with a outgoing proxy it's very useful.

This commit adds two more configurations for client about proxy, s.t.
https_proxy and no_proxy. https_proxy sets the proxy that the client
uses to pull images, while no_proxy will define the remote address that
will not be accessed by proxy.

Typical https_proxy looks like `http://127.0.0.1:5432`
no_proxy looks like `127.0.0.1,192.168.1.1`

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007 Xynnn007 changed the title client: add support to set https_proxy for client client: add support to set https_proxy/no_proxy for client Aug 24, 2024
Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this. I think having this around is probably a good idea. Would also like to note that reqwest does try to respect the HTTPS_PROXY and NO_PROXY env vars if they are set. But I think allowing this to be set programmatically is a good idea

@thomastaylor312 thomastaylor312 merged commit 657c1ca into oras-project:main Aug 29, 2024
5 checks passed
@Xynnn007 Xynnn007 deleted the feat-proxy branch August 30, 2024 00:16
@Xynnn007
Copy link
Contributor Author

Thanks for adding this. I think having this around is probably a good idea. Would also like to note that reqwest does try to respect the HTTPS_PROXY and NO_PROXY env vars if they are set. But I think allowing this to be set programmatically is a good idea

Thanks. As we have multiple reqwest client inside a same process, env would influence all clients which is not expected.

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.

2 participants