Allow Aiohttp to use proxy
hotdog809 opened this issue · 2 comments
hotdog809 commented
We have to use a proxy within our organisation to connect to data.opensanctions.org. For most Lunix applications it suffices to set the environmental variables HTTP_PROXY and HTTPS_PROXY but Aiohttp requires the flag 'trust_env=True' to read from environmental variables; https://docs.aiohttp.org/en/stable/client_advanced.html - Proxy support.
For example:
async with aiohttp.ClientSession(trust_env=True) as session: async with session.get("http://python.org") as resp: print(resp.status)
Could this, or another way of specifying a proxy, be added to Yente?
pudo commented
This is now in main. Would you be able to validate it before I cut a release and close this issue?
hotdog809 commented
Yes, thanks! This works!