Add fix for port checker. We'll see if this works this time.

This commit is contained in:
Andrew 2021-12-21 15:58:48 -05:00
parent 07d7c7ae60
commit 3ed304c378

View File

@ -97,12 +97,16 @@ class Helpers:
@staticmethod
def check_port(server_port):
try:
host_public = get('https://api.ipify.org').text
tn = telnetlib.Telnet(host_public, server_port, 10)
telnetlib.close()
a_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ip = get('https://api.ipify.org').content.decode('utf8')
location = (ip, server_port)
result_of_check = a_socket.connect_ex(location)
if result_of_check == 0:
return True
except Exception as err:
else:
return False
@staticmethod