1
|
1 #!/usr/bin/env python
|
|
2
|
|
3 """
|
|
4 dump HTTP requests
|
|
5 """
|
|
6
|
2
|
7 # imports
|
1
|
8 import optparse
|
2
|
9 import sys
|
1
|
10 import wsgiref
|
|
11
|
|
12 class RequestDumpster(object):
|
|
13
|
|
14 def __init__(self):
|
|
15 """placeholder"""
|
|
16
|
|
17 def __call__(self, environ, start_response):
|
|
18 """WSGI"""
|
|
19
|
|
20 def main(args=sys.argv[1:]):
|
|
21 """CLI"""
|
|
22
|
|
23 # parse command line arguments
|
|
24 parser = optparse.OptionParser(description=__doc__)
|
|
25 parser.add_option('-p', '--port', dest='port',
|
|
26 type='int', default=9555,
|
|
27 help="port to serve on")
|
|
28 options = parser.parse_args()
|
|
29
|
|
30 # construct url
|
|
31 url = 'http://localhost:{port}/'.format(port=options.port)
|
|
32
|
|
33 if __name__ == '__main__':
|
|
34 main()
|