Update server.py

This commit is contained in:
Namhyeon Go 2024-02-17 19:22:50 +09:00 committed by GitHub
parent caaa4a2f98
commit 0ff6119d15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -143,11 +143,14 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
try: try:
print("[*] Started the request. %s" % (str(addr[0]))) print("[*] Started the request. %s" % (str(addr[0])))
try: while True:
if scheme in [b'https', b'tls', b'ssl'] and method == b'CONNECT': try:
conn, data = proxy_connect(webserver, conn) if scheme in [b'https', b'tls', b'ssl'] and method == b'CONNECT':
except Exception as e: conn, data = proxy_connect(webserver, conn)
raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e))) except IOError as e:
print ("[*] Retrying SSL negotiation... (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
except Exception as e:
raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
response = b'' response = b''