mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-13 23:03:09 +00:00
add check if returned ipv6 address is correct
This commit is contained in:
@@ -2086,6 +2086,10 @@ def init_ip_info():
|
||||
my_ip_info["ipv4"] = get_ip_from_url(IPV4_URL1) or get_ip_from_url(IPV4_URL2)
|
||||
my_ip_info["ipv6"] = get_ip_from_url(IPV6_URL1) or get_ip_from_url(IPV6_URL2)
|
||||
|
||||
# the server can return ipv4 address instead of ipv6
|
||||
if my_ip_info["ipv6"] and ":" not in my_ip_info["ipv6"]:
|
||||
my_ip_info["ipv6"] = None
|
||||
|
||||
if my_ip_info["ipv6"] and (config.PREFER_IPV6 or not my_ip_info["ipv4"]):
|
||||
print_err("IPv6 found, using it for external communication")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user