Skip to content

Conversation

@keelerm84
Copy link
Member

This commit introduces proxy handling functionality for the hyper
transport, including automatic instrumentation through environment
variables.

If HTTPS_PROXY is defined, all HTTPS traffic will potentially be routed
through this proxy.

If HTTP_PROXY is ALSO specified, then HTTP traffic will be routed
through it. However, if HTTP_PROXY is specified without HTTPS_PROXY,
then all traffic (http and https) will be routed through the HTTP_PROXY.

This commit introduces proxy handling functionality for the hyper
transport, including automatic instrumentation through environment
variables.

If HTTPS_PROXY is defined, all HTTPS traffic will potentially be routed
through this proxy.

If HTTP_PROXY is ALSO specified, then HTTP traffic will be routed
through it. However, if HTTP_PROXY is specified without HTTPS_PROXY,
then all traffic (http and https) will be routed through the HTTP_PROXY.
@keelerm84 keelerm84 requested a review from a team as a code owner February 9, 2026 21:44
@kinyoklion
Copy link
Member

Looks like CI has a rust edition problem.

/// For HTTPS support or timeout configuration, use [`HyperTransport::builder()`].
pub fn new() -> Self {
pub fn new() -> Result<Self, std::io::Error> {
//let client = HyperTransportBuilder::default().build_http();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
//let client = HyperTransportBuilder::default().build_http();

let byte_stream: ByteStream = Box::pin(body_to_stream(body));
/// Check if the given host matches the no_proxy rules. If this function returns true, the
/// proxy should be bypassed.
fn matches(&self, host: &str) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure about the matching logic here. If nothing else it wouldn't match other no proxy implementations.

I think others would be doing some parsing of the parts.

I think these would all be different from other implementations.

  NO_PROXY=ample.com → matches "example.com"                                                                                     
  NO_PROXY=10.0.0.0/8 → won't match "10.1.2.3"                                                                         
  NO_PROXY=localhost → won't match "localhost:8080"  

Which would make be hesitant to use the NO_PROXY environment variable.

Copy link
Member

Choose a reason for hiding this comment

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

Might be good to have tests for this.

I want if we may want to considering looking at https://github.com/jdrouet/no-proxy

Copy link
Member Author

Choose a reason for hiding this comment

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

I think just using that crate directly makes a lot of sense, so I've pulled that in.

@keelerm84 keelerm84 requested a review from kinyoklion February 10, 2026 15:55
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