mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-20 20:38:08 -04:00
add checks for web compatible rpc nodes
This commit is contained in:
parent
508d074947
commit
e94f0057bf
7 changed files with 127 additions and 4 deletions
|
@ -13,13 +13,14 @@ from xmrnodes import config
|
|||
|
||||
|
||||
def make_request(url: str, path="/get_info", data=None):
|
||||
headers = {"Origin": "https://monero.fail"}
|
||||
if is_onion(url):
|
||||
proxies = {"http": f"socks5h://{config.TOR_HOST}:{config.TOR_PORT}"}
|
||||
timeout = 18
|
||||
else:
|
||||
proxies = None
|
||||
timeout = 6
|
||||
r = r_get(url + path, timeout=timeout, proxies=proxies, json=data)
|
||||
r = r_get(url + path, timeout=timeout, proxies=proxies, json=data, headers=headers)
|
||||
r.raise_for_status()
|
||||
return r
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue