-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
34 lines (31 loc) · 863 Bytes
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import argparse
import logging
from Servers import *
def keepRunning():
running = True
try:
running = True
except (KeyboardInterrupt, SystemExit):
running = False
raise
return running
#TODO: build standalone for DNS
if __name__ == '__main__':
logging.basicConfig(filename='debugging.log', level=logging.DEBUG)
logging.debug('Starting HTTP/HTTPS web servers...')
#mainItem = IOitems()
#launchOptions(mainItem)
#Model.setLists(mainItem)
#mainItem.startServers()
test = Server()
my_server = test.factory("HTTP", 8080)
my_server.run()
try:
while(keepRunning()):
time.sleep(1)
sys.stderr.flush()
sys.stdout.flush()
except (KeyboardInterrupt, SystemExit):
logging.critical('Terminated via SIGNINT')
finally:
sys.exit(1)