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 tor-client support #15
Add tor-client support #15
Conversation
Interesting. What do you perceive as the use case here? |
The use case is allowing for people who keep nodes on local hardware (ex. Raspiblitz, hack0, myNode) to expose their BTCPayServer instance to clearnet-based web stores and applications. My personal example is a webapp I'm developing to integrate BTCPayServer with live video tipping apps like Streamlabs and Streamelements -- CoinJerk |
@@ -144,6 +144,23 @@ def create_client(cls, code, host): | |||
token = client.pair_client(code) | |||
return BTCPayClient(host=host, pem=pem, tokens=token) | |||
|
|||
def create_tor_client(cls, code, host, proxy='socks5://127.0.0.1:9050'): |
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.
I think we should insert @classmethod
before this method, no? Check out the create_client()
method as an illustration.
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.
Good point, I thought I had done so. My mistake.
ping @JeffVandrewJr is this pr ready? |
@NicolasDorier I need to test on a machine with Tor running. I'll try to get that done this weekend. |
Merged, package created, and package has been uploaded to the PyPi repository as v1.3.0. Thanks @Amperture ! |
As it turns out, the python
requests
library supports using the TOR service as a proxy, and when using the service, it can reach out to .onion hidden services.This PR gives the option to create a TOR client to reach out into BTCPayServer instances behind .onion hidden services, as long as Tor is already running on the client machine.