Skip to content

Commit 74b7394

Browse files
committed
Added https proxy support
1 parent ddd672a commit 74b7394

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

ox3apiclient/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def __init__(self, domain, realm, consumer_key, consumer_secret,
4949
api_path=API_PATH,
5050
email=None,
5151
password=None,
52-
http_proxy=None):
52+
http_proxy=None,
53+
https_proxy=None):
5354
"""
5455
5556
domain -- Your UI domain. The API is accessed off this domain.
@@ -93,8 +94,11 @@ def __init__(self, domain, realm, consumer_key, consumer_secret,
9394
urllib2.build_opener(urllib2.HTTPCookieProcessor(self._cookie_jar))
9495
# Add an HTTP proxy if necessary:
9596
if http_proxy:
96-
proxy = urllib2.ProxyHandler({'http': http_proxy})
97-
opener.add_handler(proxy)
97+
http_proxy_handler = urllib2.ProxyHandler({'http': http_proxy})
98+
opener.add_handler(http_proxy_handler)
99+
if https_proxy:
100+
https_proxy_handler = urllib2.ProxyHandler({'https': https_proxy})
101+
opener.add_handler(https_proxy_handler)
98102

99103
urllib2.install_opener(opener)
100104

0 commit comments

Comments
 (0)