Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for using a proxy. #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions krakenex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class API(object):
No query rate limiting is performed.

"""
def __init__(self, key='', secret=''):
def __init__(self, key='', secret='', proxies={}):
""" Create an object with authentication information.

:param key: (optional) key identifier for queries to the API
Expand All @@ -67,6 +67,7 @@ def __init__(self, key='', secret=''):
})
self.response = None
self._json_options = {}
self.proxies = proxies
return

def json_options(self, **kwargs):
Expand Down Expand Up @@ -132,7 +133,8 @@ def _query(self, urlpath, data, headers=None, timeout=None):
url = self.uri + urlpath

self.response = self.session.post(url, data = data, headers = headers,
timeout = timeout)
timeout = timeout,
proxies = self.proxies)

if self.response.status_code not in (200, 201, 202):
self.response.raise_for_status()
Expand Down