Skip to content

Proxy modes #65

Closed
Closed

Description

@yeraydiazdiaz

Two issues stemming from discussions in #57:

  1. Whether the logic behind using tunnelling or forwarding depending on the scheme of the request, i.e. forward if HTTP, tunnel if HTTPS, belongs in HTTPCore.
    2. A discrepancy in how we deal with proxy headers between the two modes. Currently forwading extends the headers in the request with the proxy_headers argument, but tunneling only includes the proxy_headers. This forces the user into carefully constructing the proxy headers argument depending on the proxy mode which is annoying and also may result in unexpected errors when using the default proxy mode and requesting a mix of HTTP and HTTPS URLs.

Activity

  1. lovelydinosaur commented on May 4, 2020

    @lovelydinosaur
    Member

    So, I kinda agree that it'd be nice for the HTTPCore API to not support a "default" mode that switches depending on http/https requests.

    However that does impact the httpx implementation. In particular, for the default case we'd need to mount two transport instances, eg...

    {
        "http": httpcore.AsyncProxyTransport(mode="FORWARD"),
        "https": httpcore.AsyncProxyTransport(mode="TUNNEL"),
    }

    (Forgive any errors there, I'm just sketching it out.)

    I'd suggest that a good tack onto getting there would be to start with a PR to httpx that no longer uses the DEFAULT mode anywhere. That'd help us thrash out & review any implementation changes required in httpx, without actually changing any API in httpcore or httpx.

  2. yeraydiazdiaz commented on May 4, 2020

    @yeraydiazdiaz
    ContributorAuthor

    Thanks, I opened encode/httpx#927 to that effect.

    Also moving the discussion about headers to another issue.

  3. changed the title [-]Proxy modes and headers[/-] [+]Proxy modes[/+] on May 4, 2020
  4. lovelydinosaur commented on Apr 28, 2021

    @lovelydinosaur
    Member

    Closing in line with encode/httpx#927

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions