opensanctions/yente

Allow Aiohttp to use environmental variables for proxies

Closed this issue · 0 comments

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?