We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27e57bb commit 7c908dbCopy full SHA for 7c908db
telegram/utils/request.py
@@ -57,14 +57,17 @@ def _init_con_pool():
57
])
58
proxy_url = _get_con_pool_proxy()
59
if not proxy_url:
60
- mgr = urllib3.PoolManager
+ mgr = urllib3.PoolManager(**kwargs)
61
else:
62
- kwargs['proxy_url'] = proxy_url
63
if _CON_POOL_PROXY_KWARGS:
64
kwargs.update(_CON_POOL_PROXY_KWARGS)
65
- mgr = urllib3.ProxyManager
+ mgr = urllib3.proxy_from_url(proxy_url, **kwargs)
+ if mgr.proxy.auth:
66
+ # TODO: what about other auth types?
67
+ auth_hdrs = urllib3.make_headers(proxy_basic_auth=mgr.proxy.auth)
68
+ mgr.proxy_headers.update(auth_hdrs)
69
- _CON_POOL = mgr(**kwargs)
70
+ _CON_POOL = mgr
71
72
73
def is_con_pool_initialized():
0 commit comments