Created
January 22, 2018 12:54
-
-
Save ChristianWitts/168a4eee857283927b8cec6ec33dd04b to your computer and use it in GitHub Desktop.
Quick simple
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 python | |
# $ setenforce Permissive | |
import SimpleHTTPServer | |
import SocketServer | |
import logging | |
import os | |
PORT = os.getenv("PORT", 8000) | |
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
logging.error(self.headers) | |
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) | |
Handler = GetHandler | |
httpd = SocketServer.TCPServer(("", PORT), Handler) | |
httpd.serve_forever() | |
# vim: ft=python ts=4 sw=4 expandtab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment