Update server.py
Some checks failed
/ check (push) Failing after 18s

This commit is contained in:
Nova Cat 2025-01-26 01:00:28 -08:00
parent d6e507ad7f
commit ae23a08881

View file

@ -754,7 +754,7 @@ def tcp_session(sock):
print("Waiting for connection...") print("Waiting for connection...")
connection, client = sock.accept() connection, client = sock.accept()
ip_to = restrict_ip ip_to = restrict_ip
threading.Thread(target=session, daemon=True, args=[connection, client, ip_to]).start() threading.Thread(target=session, daemon=True, args=[context.wrap_socket(connection, client, ip_to]).start()
except: except:
print("Something went wrong...") print("Something went wrong...")
print(traceback.format_exc()) print(traceback.format_exc())
@ -762,13 +762,12 @@ def ssl_session(sock2):
while True: while True:
try: try:
while opened: while opened:
context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
context.load_cert_chain(ssl_cert, keyfile=ssl_pkey) context.load_cert_chain(ssl_cert, keyfile=ssl_pkey)
with context.wrap_socket(sock2, server_side=True) as sock: print("Waiting for connection...")
print("Waiting for connection...") connection, client = sock.accept()
connection, client = sock.accept() ip_to = restrict_ip
ip_to = restrict_ip threading.Thread(target=session, daemon=True, args=[context.wrap_socket(connection, server_side=True), client, ip_to, True]).start()
threading.Thread(target=session, daemon=True, args=[connection, client, ip_to, True]).start()
except: except:
print("Something went wrong...") print("Something went wrong...")
print(traceback.format_exc()) print(traceback.format_exc())