Skip to content

Commit

Permalink
Update system.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fodhelper authored Apr 8, 2024
1 parent 94dd842 commit 4e5ef0c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions app/utils/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,6 @@ def get_public_ip():
except:
pass

try:
resp = requests.get('http://icanhazip.com/', timeout=5).text.strip()
if ipaddress.IPv4Address(resp).is_global:
return resp
elif ipaddress.IPv6Address(resp).is_global:
return '[%s]' % resp
except:
pass

return '127.0.0.1'


def get_public_ipv4():
try:
resp = requests.get('http://api4.ipify.org/', timeout=5).text.strip()
if ipaddress.IPv4Address(resp).is_global:
return resp
except:
pass

try:
resp = requests.get('http://ipv4.icanhazip.com/', timeout=5).text.strip()
if ipaddress.IPv4Address(resp).is_global:
Expand Down

0 comments on commit 4e5ef0c

Please sign in to comment.