parent
874b1ab10c
commit
b64054c9b7
1 changed files with 12 additions and 13 deletions
|
@ -915,9 +915,8 @@ def session(connection, client, ip, isssl=False):
|
|||
except:
|
||||
print(traceback.format_exc())
|
||||
def tcp_session(sock, ip_to):
|
||||
while True:
|
||||
try:
|
||||
while opened:
|
||||
try:
|
||||
print("Waiting for connection...")
|
||||
connection, client = sock.accept()
|
||||
threading.Thread(target=session, daemon=True, args=[connection, client, ip_to]).start()
|
||||
|
@ -925,9 +924,9 @@ def tcp_session(sock, ip_to):
|
|||
print("Something went wrong...")
|
||||
print(traceback.format_exc())
|
||||
def ssl_session(sock, ip_to):
|
||||
while True:
|
||||
try:
|
||||
while opened:
|
||||
try:
|
||||
print("Waiting for SSL connection...")
|
||||
connection, client = sock.accept()
|
||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
||||
ctx.load_cert_chain(ssl_cert, keyfile=ssl_pkey)
|
||||
|
|
Loading…
Add table
Reference in a new issue