Skip to content

Add proxy_auth argument to HTTPProxy - #481

Merged
lovelydinosaur merged 2 commits into
masterfrom
proxy-header
Jan 17, 2022
Merged

lovelydinosaur merged 2 commits into
masterfrom
proxy-header

Conversation

@lovelydinosaur

Copy link
Copy Markdown
Member

This change allows users to specify a proxy_auth argument to HTTPProxy...

http = httpcore.HTTPProxy(proxy_url=..., proxy_auth=...)

Previously any authentication had to be included using the proxy_headers argument, and the user was responsible for creating a correctly formed "Proxy-Authorization" header.

This addition is prompted by the recent addition of SOCKSProxy, which takes a proxy_auth argument, and doesn't have any proxy_headers argument, because HTTP headers aren't used with socks. Making sure both styles of proxy are aligned here feels more consistent.

We'd also want a generic proxy_auth argument rather than a pre-built header if we ever want to be able to support both basic and digest auth styles. (Because we'd want to just be specifying the username and password, rather than pre-defining what HTTP headers and auth flow are expected by the proxy.)

@lovelydinosaur
lovelydinosaur merged commit ce66166 into master Jan 17, 2022
@lovelydinosaur
lovelydinosaur deleted the proxy-header branch January 17, 2022 16:22
@lovelydinosaur lovelydinosaur mentioned this pull request Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant