This commit is contained in:
callebtc
2022-10-29 22:55:32 +02:00
parent 77c66880c1
commit d6fa754a6d
3 changed files with 31 additions and 13 deletions

19
tests/test_tor.py Normal file
View File

@@ -0,0 +1,19 @@
import requests
from cashu.tor.tor import TorProxy
def test_tor_setup():
s = requests.Session()
tor = TorProxy(keep_alive=False)
tor.wait_until_startup()
socks_host, socks_port = "localhost", 9050
proxies = {
"http": f"socks5://{socks_host}:{socks_port}",
"https": f"socks5://{socks_host}:{socks_port}",
}
s.proxies.update(proxies)
resp = s.get("https://google.com")
resp.raise_for_status()