exo
exo copied to clipboard
Request: respect `https_proxy` and `http_proxy` env variables for network requests
Description
I encountered an issue where exo
does not respect the https_proxy
and http_proxy
environment variables for network requests, even though the system environment is properly configured.
The root cause appears to be the way aiohttp
is used in the exo
codebase. aiohttp
supports proxy usage via environment variables through setting trust_env=True
for aiohttp.ClientSession . However, it seems the current implementation in exo
does not leverage this feature.
This limitation prevents users from routing traffic through a proxy, which is critical in certain network setups such as corporate environments or restricted networks.
Steps to Reproduce
- Set up proxy environment variables:
export http_proxy=http://proxy-server:port
export https_proxy=http://proxy-server:port
- Run exo with a command that makes network requests (e.g., model downloading).
- Observe that the requests do not route through the specified proxy, and connections fail in environments where direct access is blocked.
Expected Behavior
exo
should honor the http_proxy
, https_proxy
, and no_proxy environment variables automatically when making network requests.
Actual Behavior
exo
fails to use the proxy settings, resulting in connection errors in proxied environments.
Proposed Solution
Update the aiohttp
usage in exo
to automatically respect environment proxy settings. This can be achieved by ensuring that trust_env=True
is explicitly passed to aiohttp.ClientSession()
like this:
async with aiohttp.ClientSession(trust_env=True) as session:
async with session.get(url) as response:
print(await response.text())
Environment
exo
version: latest main branch
aiohttp version: aiohttp-3.10.11
Operating System: windows11+wsl(ubuntu 20.04)
Python Version: 3.12