-
Notifications
You must be signed in to change notification settings - Fork 19
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 proxy support for futures and spot clients (async and sync) #257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Graeme22, after applying the suggested changes, I'm happy with the proposed change.
I see that the CI jobs didn't start, have you activated those on your feature branch? Locally they just ran through, but having those demonstrated here as well would be preferable.
Co-authored-by: Benjamin T. Schwertfeger <development@b-schwertfeger.de>
Great!
I just activated them, looks like you need to approve the changes for them to run. |
I can't see anything to approve for the actions. I'll check that behavior using another account tomorrow. |
Merging by hand now - with failing tests - since they're just failing due to wrong setup which is not that important for this change. (Some environment variables are not set in the author's repository.) |
Summary
For context see: #256
This PR adds support for HTTP proxies to use with spot and futures REST clients, both sync and async.
For now websockets are omitted as the
websockets
library does not support proxies. The motivation is to allow for privacy/unblocking or other security-related concerns.Changes / Features
A single argument,
proxy
, has been added to the constructors for all REST clients. This proxy is used for all requests placed with those clients. Tests have also been added for all four variations:SpotClient
,SpotAsyncClient
,FuturesClient
, andFuturesAsyncClient
. The most relevant changes are included in thekraken/base_api/__init__.py
file and in the new tests.Closes: #256