httpx ignores no_proxy and https_proxy in docker-compose
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 76
- Avg merge
- 8h 59m
- Merged PRs (30d)
- 24
Description
Originally opened by
@lsch0lzon 2023-05-19 09:02:03 in encode/httpx
When I use httpx inside a Docker container that was built with the http_proxy and http_proxy environment variables, I cannot ignore these variables when starting the container via docker-compose.
I set the no_proxy variable when starting the container so that the container should ignore any proxies it was built with.
httpx still uses those proxies. To solve this I had to set trust_env=False in my AsyncClient.
Is this expected behaviour? I thought that disabling the proxies in the docker-compose file would automatically tell httpx to ignore them when making a request.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the proxy behavior in Docker Compose with http_proxy, https_proxy, and no_proxy, comparing it with AsyncClient using trust_env=False. Trace how the environment is interpreted during a request; done means no_proxy causes matching destinations to bypass the configured proxies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100