Created
November 7, 2025 14:05
-
-
Save makkes/7a078c325e44100500b0b884c266a1d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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