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 <[email protected]>
@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.

flavio added a commit to flavio/rust-oci-client that referenced this pull request Oct 7, 2024
== What's Changed
* client: add support to set https_proxy/no_proxy for client by @Xynnn007 in oras-project#160
* chore(deps): Update testcontainers requirement from 0.20 to 0.22 by @dependabot in oras-project#161
* Docs.rs badge, update crate name. by @bddap in oras-project#166
* chore(deps): Bump actions/checkout from 4.1.7 to 4.2.0 by @dependabot in oras-project#170
* chore(deps): Update testcontainers requirement from 0.22 to 0.23 by @dependabot in oras-project#169
* chore(deps): Update rstest requirement from 0.22.0 to 0.23.0 by @dependabot in oras-project#168
* Allow doing start-end RANGE requests against blobs by @thundergolfer in oras-project#163
* fix(client): Return the digest header for partial responses by @thomastaylor312 in oras-project#171
* remove reference by @flavio in oras-project#164

== New Contributors
* @bddap made their first contribution in oras-project#166
* @thundergolfer made their first contribution in oras-project#163

**Full Changelog**: oras-project/rust-oci-client@v0.12.1...v0.13.0

Signed-off-by: Flavio Castelli <[email protected]>
@flavio flavio mentioned this pull request Oct 7, 2024
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