Доработка. Рефактор
This commit is contained in:
17
https-server.py
Normal file
17
https-server.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user