Repository navigation
Problem with proxies parameter in AsyncClient after update to 0.28.0 #3490
Replies: 1 comment
|
HTTPX removed the deprecated "proxies=" argument in version 0.28.0. For different HTTP and HTTPS proxy configurations, use "mounts=" with "AsyncHTTPTransport" instances. For example: import httpx proxy_config = { async with httpx.AsyncClient(mounts=proxy_config) as client: Replace the example proxy addresses with your actual proxy endpoints. If both schemes use the same proxy, you can use the simpler "proxy=" argument instead. The official changelog confirms that "proxies=" was removed in 0.28.0 and recommends "mounts=" for complex configurations: Proxy configuration docs: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
After updating to version 0.28.1, the
proxiesparameter is no longer accepted inhttpx.AsyncClient, resulting in the following error:TypeError("AsyncClient.init() got an unexpected keyword argument 'proxies'")
Before this update, the
proxiesparameter was correctly used to configure proxies directly in theAsyncClientinstance. However, with the current version, attempting to pass theproxiesparameter to configure proxies results in the error mentioned above.Steps to Reproduce:
httpxin your virtual environment.AsyncClientwith theproxiesparameter configured:How can I configure multiple proxies (both HTTP and HTTPS) in version 0.28.1 of httpx, considering that the proxies parameter is no longer accepted?
All reactions