update proxies to include https onions

pull/13/head
lza_menace 3 years ago
parent e94f0057bf
commit e0dc8257e1

@ -15,12 +15,13 @@ from xmrnodes import config
def make_request(url: str, path="/get_info", data=None): def make_request(url: str, path="/get_info", data=None):
headers = {"Origin": "https://monero.fail"} headers = {"Origin": "https://monero.fail"}
if is_onion(url): if is_onion(url):
proxies = {"http": f"socks5h://{config.TOR_HOST}:{config.TOR_PORT}"} _p = f"socks5h://{config.TOR_HOST}:{config.TOR_PORT}"
timeout = 18 proxies = {"http": p, "https": p}
timeout = 30
else: else:
proxies = None proxies = None
timeout = 6 timeout = 10
r = r_get(url + path, timeout=timeout, proxies=proxies, json=data, headers=headers) r = r_get(url + path, timeout=timeout, proxies=proxies, json=data, headers=headers, verify=False)
r.raise_for_status() r.raise_for_status()
return r return r

Loading…
Cancel
Save