Skip to content

Recognize and support proxies #416

Description

@abonander

Use case

The reqwest crate supports system HTTP(S) forward proxies configured by environment variable: https://docs.rs/reqwest/latest/reqwest/#proxies

  • HTTP_PROXY/http_proxy
  • HTTPS_PROXY/https_proxy
  • ALL_PROXY/all_proxy

However, since we use the hyper crate directly, we don't get support for proxies out of the box and we have not implemented it manually yet.

Describe the solution you'd like

Switching to the reqwest crate would automatically give us proxies as well as proper HTTP connection pooling (and would transitively close #313).

I had previously recommended this but there was the concern that we would lose performance because we don't have as tight of control over the HTTP connection. This assumption should really be tested, however.

Describe the alternatives you've considered

The equivalent proxy support is available in the hyper-util crate: https://docs.rs/hyper-util/latest/hyper_util/client/proxy/matcher/struct.Matcher.html#method.from_env

This should give us the exact same behavior as reqwest (it's what reqwest uses under the hood) but we'd still have to implement and test this ourselves to be certain it works correctly. Using reqwest would push that technical debt upstream.

Additional context

Requested by @keltia on the ClickHouse Community Slack: https://clickhousedb.slack.com/archives/CU478UEQZ/p1775582175943629

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions