Http Proxy Env Setting #5855
-
Can I set the http proxy for aiohttp module globally? Just like set proxy for git:
Actually, I am trying to set the proxy for another Python program which mainly using aiohttp to download files. Setting such environment key is an easier way for me. Perhaps, is there has any alternative solution for me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you set |
Beta Was this translation helpful? Give feedback.
If you set
trust_env=True
in yourClientSession
instance, it'll automatically use the values of the standardHTTP_PROXY
/HTTPS_PROXY
env vars and the credentials from~/.netrc
: https://docs.aiohttp.org/en/stable/client_reference.html#aiohttp.ClientSession.trust_env.