Turning on/off Proxies via client method!
Open
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
@AmericanYon 2022-04-23 03:49:12 in encode/httpx
import trio
import httpx
proxies = {
'all://': 'http:127.0.0.1:8866'
}
async def main():
async with httpx.AsyncClient(timeout=10, proxies=proxies) as client:
# how do i access proxies here which i previously set?
# print(client.proxies)
# imagine that i will do some operations here and then i would like to turn off proxies
# client.proxies = False
if __name__ == "__main__":
trio.run(main)
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 examining how httpx.AsyncClient accepts and stores the proxies argument, including the client lifecycle shown in the example. Define the expected public behavior for inspecting and turning proxies off after initialization, then add coverage demonstrating proxy use followed by disabled-proxy operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100