SHARE
TWEET

Untitled

a guest Dec 7th, 2014 329 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import BaseHTTPServer, SimpleHTTPServer
  2. import ssl
  3. # razor4x - tasteless
  4. class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  5.     def do_GET(s):
  6.         s.send_response(200))
  7.         s.send_header("Content-type", "text/html")
  8.         s.end_headers()
  9.         s.wfile.write("<html><head><title>Title goes here.</title></head>")
  10.         s.wfile.write("<body><p>This is a test.</p>")
  11.         s.wfile.write("<p>You accessed path: %s</p>" % s.path)
  12.         s.wfile.write("</body></html>")
  13.  
  14. httpd = BaseHTTPServer.HTTPServer(('192.168.0.4', 31337),MyHandler)# SimpleHTTPServer.SimpleHTTPRequestHandler)
  15. httpd.socket = ssl.wrap_socket (httpd.socket, certfile='server.pem', server_side=True)
  16. httpd.serve_forever()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top