mirror of
https://github.com/basicswap/basicswap.git
synced 2025-03-12 09:38:03 +00:00
util: bypass tor for .local domains
This commit is contained in:
parent
b5f6eb6526
commit
b484827c15
1 changed files with 2 additions and 1 deletions
|
@ -15,9 +15,10 @@ from urllib.request import Request, urlopen
|
|||
|
||||
|
||||
def is_private_ip_address(addr: str):
|
||||
# Will return false for all URLs
|
||||
if addr == 'localhost':
|
||||
return True
|
||||
if addr.endswith('.local'):
|
||||
return True
|
||||
try:
|
||||
return ipaddress.ip_address(addr).is_private
|
||||
except Exception:
|
||||
|
|
Loading…
Reference in a new issue