You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
(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.
Activity
lovelydinosaur commentedon May 4, 2020
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
httpximplementation. 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
httpxthat no longer uses the DEFAULT mode anywhere. That'd help us thrash out & review any implementation changes required inhttpx, without actually changing any API inhttpcoreorhttpx.yeraydiazdiaz commentedon May 4, 2020
Thanks, I opened encode/httpx#927 to that effect.
Also moving the discussion about headers to another issue.
[-]Proxy modes and headers[/-][+]Proxy modes[/+]lovelydinosaur commentedon Apr 28, 2021
Closing in line with encode/httpx#927