pydantic / pydantic/httpx2

Turning on/off Proxies via client method!

Open
#682 0 comments 0 reactions 0 assignees View on GitHub

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 @AmericanY on 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.