Skip to content

Commit a64cbd1

Browse files
committed
add proxy fix for async ws client
1 parent 29b0e00 commit a64cbd1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

binance/async_client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ def __init__(
4242
self.https_proxy = https_proxy
4343
self.loop = loop or get_loop()
4444
self._session_params: Dict[str, Any] = session_params or {}
45+
46+
# Convert https_proxy to requests_params format for BaseClient
47+
if https_proxy and requests_params is None:
48+
requests_params = {'proxies': {'http': https_proxy, 'https': https_proxy}}
49+
elif https_proxy and requests_params is not None:
50+
if 'proxies' not in requests_params:
51+
requests_params['proxies'] = {}
52+
requests_params['proxies'].update({'http': https_proxy, 'https': https_proxy})
53+
4554
super().__init__(
4655
api_key,
4756
api_secret,

0 commit comments

Comments
 (0)