Add bin/element-web
This commit is contained in:
parent
5e417a6b6c
commit
7411092df4
1 changed files with 21 additions and 0 deletions
21
bin/element-web
Executable file
21
bin/element-web
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python3
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
import os
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
class HTTPServer6(HTTPServer):
|
||||
address_family = socket.AF_INET6
|
||||
|
||||
class SilentSimpleHTTPRequestHandler(SimpleHTTPRequestHandler):
|
||||
def log_message(self, format, *args):
|
||||
pass
|
||||
|
||||
os.chdir('/opt/pkg/share/element-web')
|
||||
|
||||
httpd = HTTPServer6(('::1', 4443), SilentSimpleHTTPRequestHandler)
|
||||
httpd.socket = ssl.wrap_socket(httpd.socket,
|
||||
keyfile=os.path.expanduser("~/.local/share/element-web/key.pem"),
|
||||
certfile=os.path.expanduser("~/.local/share/element-web/cert.pem"),
|
||||
server_side=True)
|
||||
httpd.serve_forever()
|
Loading…
Add table
Add a link
Reference in a new issue