Files
uarep-ctl/https-server.py
2025-11-08 11:04:31 +03:00

18 lines
466 B
Python

#!/usr/bin/env python3
from http import server # Python 3
import ssl
import os
class MyHTTPRequestHandler(server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if __name__ == '__main__':
html_dir = os.path.join(os.path.dirname(__file__), 'html')
os.chdir(html_dir)
srv = server.HTTPServer(('', 8000), MyHTTPRequestHandler)
sdc = ssl.create_default_context()
srv.serve_forever()