From 75c19104aeb0af2a6fca8184943d687dba76d791 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 15 Feb 2023 17:22:34 +0000 Subject: [PATCH] fix ipv6 with checkconn --- src/gam/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 11a36561..cc2e220a 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -782,9 +782,9 @@ def checkConnection(): success_count = 0 for host in hosts: try_count += 1 - ip = socket.gethostbyname(host) + ip = socket.getaddrinfo(host, None)[0][-1][0] # works with ipv6 check_line = f'Checking {host} ({ip}) ({try_count}/{host_count})...' - sys.stdout.write(f'{check_line:<80}') + sys.stdout.write(f'{check_line:<100}') sys.stdout.flush() try: httpc.request(f'https://{host}/', 'HEAD', headers=headers)