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
| # Extended python -m http.serve with --username and --password parameters for | |
| # basic auth, based on https://gist.github.com/fxsjy/5465353 | |
| from functools import partial | |
| from http.server import SimpleHTTPRequestHandler, test | |
| import base64 | |
| import os | |
| class AuthHTTPRequestHandler(SimpleHTTPRequestHandler): |
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
| import http.server | |
| import cgi | |
| import base64 | |
| import json | |
| from urllib.parse import urlparse, parse_qs | |
| class CustomServerHandler(http.server.BaseHTTPRequestHandler): | |
| def do_HEAD(self): |
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
| ''' | |
| SimpleSecureHTTPServer.py - simple HTTP server supporting SSL. | |
| - replace fpem with the location of your .pem server file. | |
| - the default port is 443. | |
| usage: python SimpleSecureHTTPServer.py | |
| Credit: https://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/ | |
| License: PSF License |