Guest User

Untitled

a guest
Jan 17th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import SimpleHTTPServer
  2. import SocketServer
  3.  
  4. #Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
  5. PORT = 8000
  6.  
  7. class CustomHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
  8. def do_GET(self):
  9. self.send_response(200)
  10. self.send_header('Content-type', 'text/plain')
  11. self.end_headers()
  12. self.wfile.write("cool\n")
  13. def log_request(self, code='-', caca=''):
  14. return
  15.  
  16. httpd = SocketServer.ThreadingTCPServer(("localhost", PORT), CustomHandler)
  17.  
  18. print "serving at port", PORT
  19. httpd.serve_forever()
Add Comment
Please, Sign In to add comment