Update server.py

This commit is contained in:
Namhyeon Go 2024-07-11 16:45:21 +09:00 committed by GitHub
parent afc974ae37
commit 60bcc14a93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,6 +167,9 @@ def proxy_connect(webserver, conn):
hostname = webserver.decode(client_encoding)
certpath = "%s/%s.crt" % (certdir.rstrip('/'), hostname)
if not os.path.exists(certdir):
os.makedirs(certdir)
# https://stackoverflow.com/questions/24055036/handle-https-request-in-proxy-server-by-c-sharp-connect-tunnel
conn.send(b'HTTP/1.1 200 Connection Established\r\n\r\n')