Skip to content

Conversation

@byronwang2005
Copy link
Contributor

📝 Pull Request Template

1. Related Issue

Closes #495

2. Type of Change (select one)

Type of Change: Bug Fix

3. Description

Summary

  • Enable aiohttp_trust_env=True when instantiating ccxt.pro exchange objects, allowing environment variables such as HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY to take effect for market data fetching.
  • Unify proxy behavior across REST/WS asynchronous channels, resolving timeout or direct-connection failures for calls like fetch_ohlcv and fetch_ticker in proxy-requiring network environments.

Motivation & Background

  • aiohttp by default ignores system proxy environment variables, causing ccxt.pro’s async requests to fail in environments where proxies are required for external API access.
  • Enabling aiohttp_trust_env allows ccxt.pro to transparently respect proxy settings from .env files or process environments—no need to manually inject proxy config per call.

4. Testing

  • I have tested this locally.
  • I have updated or added relevant tests.

5. Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RequestTimeout on OKX due to missing aiohttp_trust_env=True

1 participant