mitmproxy/pathod
Aldo Cortesi 77eca33f26 Refactor application definitions and startup.
Also, create one of the dodgiest web testing trusses in history. Tornado just
seems to have no nice way of doing this.
2012-04-29 10:56:33 +12:00

23 lines
676 B
Python
Executable File

#!/usr/bin/env python
import argparse
from libpathod import app
import tornado.ioloop
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument("-p", dest='port', default=8888, type=int, help='Port.')
parser.add_argument(
"-s", dest='staticdir', default=None, type=str,
help='Directory for static files.'
)
args = parser.parse_args()
application = app.PathodApp(
staticdir=args.staticdir
)
print "pathod listening on port %s"%args.port
try:
app.run(application, args.port, None)
except KeyboardInterrupt:
pass