Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbers committed Aug 1, 2018
2 parents 534b26c + c227850 commit e4473d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mtprotoproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ def init_ip_info():
TIMEOUT = 5

try:
with urllib.request.urlopen('https://v4.ifconfig.co/ip', timeout=TIMEOUT) as f:
with urllib.request.urlopen('http://ipv4.myexternalip.com/raw', timeout=TIMEOUT) as f:
if f.status != 200:
raise Exception("Invalid status code")
my_ip_info["ipv4"] = f.read().decode().strip()
Expand All @@ -1072,7 +1072,7 @@ def init_ip_info():

if PREFER_IPV6:
try:
with urllib.request.urlopen('https://v6.ifconfig.co/ip', timeout=TIMEOUT) as f:
with urllib.request.urlopen('http://ipv6.myexternalip.com/raw', timeout=TIMEOUT) as f:
if f.status != 200:
raise Exception("Invalid status code")
my_ip_info["ipv6"] = f.read().decode().strip()
Expand Down

0 comments on commit e4473d6

Please sign in to comment.