Dynamically change proxy in AsyncClient #2939
Unanswered
ManiMozaffar
asked this question in
Potential Issue
Replies: 1 comment
-
|
You can always do such things by accessing the private API, like this: import httpx
from httpx._utils import URLPattern
client = httpx.Client()
for i in range(10):
client._mounts = {
URLPattern("all://"): httpx.HTTPTransport(proxy=get_random_proxy())
}
client.get("https://example.com")But I don't really recommend using this approach. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
following #1376 I still think this is an issue
I'm trying to send requests from 1k ips, 10 at a time, so I need to create 1k client, this seems to be an overheard, where ALL other python request libraries allow you to change proxy on fly per request.
Beta Was this translation helpful? Give feedback.
All reactions