Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import SimpleHTTPServer
- import SocketServer
- #Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
- PORT = 8000
- class CustomHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
- def do_GET(self):
- self.send_response(200)
- self.send_header('Content-type', 'text/plain')
- self.end_headers()
- self.wfile.write("cool\n")
- def log_request(self, code='-', caca=''):
- return
- httpd = SocketServer.ThreadingTCPServer(("localhost", PORT), CustomHandler)
- print "serving at port", PORT
- httpd.serve_forever()
Add Comment
Please, Sign In to add comment