feat(cyper): proxy support#57
Merged
Merged
Conversation
Co-authored-by: DeepSeek <service@deepseek.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class proxy support to the cyper HTTP client, including forward proxies, CONNECT tunneling for HTTPS, optional SOCKS support, and related integration tests.
Changes:
- Introduces
cyper::proxymodule withProxy/NoProxyconfiguration and matching logic (including env/system proxy support). - Updates client/connector/stream plumbing to route connections via matched proxies, including CONNECT tunneling and proxy auth handling.
- Adds comprehensive proxy integration tests (forward proxy, auth, CONNECT behavior, multiple proxies, no-proxy bypass).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
cyper/src/proxy.rs |
New proxy configuration/matching layer (Proxy, NoProxy, matchers, auth/headers helpers). |
cyper/src/client.rs |
ClientBuilder proxy configuration + request-time injection of proxy auth/custom headers. |
cyper/src/connector.rs |
Proxy-aware connector: chooses between direct, forward-proxy, CONNECT tunnel, and SOCKS paths. |
cyper/src/stream.rs |
Refactors HttpStream to carry proxy/H2 flags, adds wrapping/splitting support for proxy + tunneled flows. |
cyper-core/src/stream.rs |
Adds futures_util::AsyncRead/AsyncWrite impls to support splitting/wrapping strategy. |
cyper/tests/proxy.rs |
New integration tests covering forward proxy, auth, CONNECT error handling, no-proxy bypass, and proxy selection. |
cyper/src/lib.rs |
Exposes proxy module publicly and adds Error::Proxy. |
cyper/src/nyquest/mod.rs |
Enables use_default_proxy behavior by toggling proxy usage instead of erroring. |
cyper/src/into_url.rs |
Extends IntoUrl with as_str() to support proxy URL parsing convenience. |
cyper/src/backend.rs |
Switches TLS cfg gating to the new tls cfg alias. |
cyper/build.rs |
Adds cfg_aliases build script for tls cfg alias. |
cyper/Cargo.toml |
Enables hyper-util proxy support, adds cfg_aliases build-dep, introduces socks feature flag. |
Cargo.toml |
Adds cfg_aliases to workspace dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.