Skip to content

Instantly share code, notes, and snippets.

View cddmp's full-sized avatar

Martin Weißbach cddmp

View GitHub Profile
# Originally taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
from http.server import HTTPServer, SimpleHTTPRequestHandler
import os, ssl, sys
# Unfortunately, this will only work if the client sends a request and does not only do a TCP 3-way handshake
class CustomRequestHandler(SimpleHTTPRequestHandler):
def handle_one_request(self):
print(f'[*] Incoming connection: {self.client_address[0]}')
return SimpleHTTPRequestHandler.handle_one_request(self)