-
Notifications
You must be signed in to change notification settings - Fork 0
/
httpserver
executable file
·30 lines (26 loc) · 1001 Bytes
/
httpserver
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
#!/usr/bin/env python3
# httpserver - Contains script to run a HTTPServer locally
# +-----------+
# | Imports |
# +-----------+
import argparse
from src.httpserver import *
# +-----------------+
# | Main Function |
# +-----------------+
if __name__ == '__main__':
# Parse arguments
parser = argparse.ArgumentParser(description='HTTP server')
parser.add_argument('-p', '--port',
dest='port', type=int, required=True,
help='The port to use')
parser.add_argument('-o', '--origin',
dest='origin', type=str, required=True,
help='The name of the origin server for the CDN')
parser.add_argument('-v', '--verbose',
dest='verbose', action='store_true', default=False,
help='Runs the server in verbose mode')
args = parser.parse_args()
# Start a HTTPServer with given arguments
server = HTTPServer(args)
server.start()