mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
util: bypass tor for .local domains
This commit is contained in:
@@ -15,9 +15,10 @@ from urllib.request import Request, urlopen
|
|||||||
|
|
||||||
|
|
||||||
def is_private_ip_address(addr: str):
|
def is_private_ip_address(addr: str):
|
||||||
# Will return false for all URLs
|
|
||||||
if addr == 'localhost':
|
if addr == 'localhost':
|
||||||
return True
|
return True
|
||||||
|
if addr.endswith('.local'):
|
||||||
|
return True
|
||||||
try:
|
try:
|
||||||
return ipaddress.ip_address(addr).is_private
|
return ipaddress.ip_address(addr).is_private
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user