Skip to content

Conversation

@HarikrishnanTechie
Copy link

@HarikrishnanTechie HarikrishnanTechie commented Jan 3, 2025

Issue:
The connect request does not include host details when operating in a proxy environment. This can lead to failures in establishing a proper connection, as the host information is essential for routing the request through the proxy.

Code Explanation:
To address this issue, the following approach is used:

Check for Host in Proxy Settings:
If the proxy_kwargs dictionary contains a host key, it indicates that host details are available.

Add Host to Proxy Headers:
These host details are added to the proxy_headers dictionary under the Host key. By doing so, the host information is explicitly included in the proxy headers, ensuring that the connect request incorporates the correct routing details.

Impact:
Including the host details in the proxy_headers ensures that the connect request is properly formed and able to route through the proxy environment without any missing information. This resolves the issue and enhances connectivity reliability

@sigmavirus24
Copy link
Contributor

We should resolve urllib3/urllib3#3532 first. Both of these PRs lack tests and the correct way to handle the header in question

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants