Skip to content

Instantly share code, notes, and snippets.

@makkes
Created November 7, 2025 14:05
Show Gist options
  • Select an option

  • Save makkes/7a078c325e44100500b0b884c266a1d0 to your computer and use it in GitHub Desktop.

Select an option

Save makkes/7a078c325e44100500b0b884c266a1d0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import http.server as SimpleHTTPServer
import socketserver as SocketServer
PORT = 8000
class GetHandler(
SimpleHTTPServer.SimpleHTTPRequestHandler
):
def do_GET(self):
print(self.client_address[0])
print(self.headers)
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
Handler = GetHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment