mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-29 18:31:38 +00:00
fix ipv6 with checkconn
This commit is contained in:
@@ -782,9 +782,9 @@ def checkConnection():
|
|||||||
success_count = 0
|
success_count = 0
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
try_count += 1
|
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})...'
|
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()
|
sys.stdout.flush()
|
||||||
try:
|
try:
|
||||||
httpc.request(f'https://{host}/', 'HEAD', headers=headers)
|
httpc.request(f'https://{host}/', 'HEAD', headers=headers)
|
||||||
|
|||||||
Reference in New Issue
Block a user