Skip to content

Commit

Permalink
Merge pull request #145 from gangeli/master
Browse files Browse the repository at this point in the history
Allow authenticating with proxy
  • Loading branch information
eli-darkly authored Sep 16, 2020
2 parents 6c566a6 + 3095315 commit eb7fc76
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ldclient/impl/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,18 @@ def create_pool_manager(self, num_pools, target_base_uri):
ca_certs=ca_certs
)
else:
# Get proxy authentication, if provided
url = urllib3.util.parse_url(proxy_url)
proxy_headers = None
if url.auth != None:
proxy_headers = urllib3.util.make_headers(proxy_basic_auth=url.auth)
# Create a proxied connection
return urllib3.ProxyManager(
proxy_url,
num_pools=num_pools,
cert_reqs=cert_reqs,
ca_certs = ca_certs
ca_certs = ca_certs,
proxy_headers=proxy_headers
)

def _get_proxy_url(target_base_uri):
Expand Down

0 comments on commit eb7fc76

Please sign in to comment.