forked from moneysocket/costanza
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
executable file
·21 lines (19 loc) · 769 Bytes
/
server.py
File metadata and controls
executable file
·21 lines (19 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
# Copyright (c) 2020 Jarret Dyrbye
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php
import sys
from twisted.internet import reactor, ssl
from twisted.python import log
from twisted.web.server import Site
from twisted.web.static import File
if __name__ == '__main__':
log.startLogging(sys.stdout)
# use the keys from the autobahn example repo
contextFactory = ssl.DefaultOpenSSLContextFactory('keys/server.key',
'keys/server.crt')
root = File("htdocs/")
site = Site(root)
print("serving SSL at localhost:8080");
reactor.listenSSL(8080, site, contextFactory)
reactor.run()