lol
!/usr/bin/env/python
import BaseHTTPServer, SimpleHTTPServer
import ssl
certfile = "./localhost.pem"
keyfile = "./localhost-key.pem"
class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def endheaders(self):
self.sendheader("Cache-Control", "no-cache, no-store, must-revalidate")
self.sendheader("Pragma", "no-cache")
self.sendheader("Expires", "0")
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
httpd = BaseHTTPServer.HTTPServer(
('', 8080),
RequestHandler
)
httpd.socket = ssl.wrapsocket(
httpd.socket,
serverside=True,
keyfile=keyfile,
certfile=certfile
)
httpd.serve_forever()
2
votes
