aboutsummaryrefslogtreecommitdiffstats
path: root/pathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-10-01 12:48:26 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-10-01 12:48:26 +1300
commit41f1c66772c6546fc39b9dcf64d8c04992a2e1ab (patch)
treed23e4c8eac5da25693f936e5e77d9fdb2b015e71 /pathod
parent915bcfbd305d7b18de07f4f40dab1e49a06b132c (diff)
downloadmitmproxy-41f1c66772c6546fc39b9dcf64d8c04992a2e1ab.tar.gz
mitmproxy-41f1c66772c6546fc39b9dcf64d8c04992a2e1ab.tar.bz2
mitmproxy-41f1c66772c6546fc39b9dcf64d8c04992a2e1ab.zip
Add -q and -r flags to pathod, logging request and respnose bytes.
- These flags also mean that a bytes log is included in the internal log buffer. - There's an -x flag to turn on hex dump output in the text logs (does not affect the log buffer).
Diffstat (limited to 'pathod')
-rwxr-xr-xpathod33
1 files changed, 24 insertions, 9 deletions
diff --git a/pathod b/pathod
index 91cd13e3..e692a935 100755
--- a/pathod
+++ b/pathod
@@ -89,7 +89,10 @@ def main(parser, args):
nocraft = args.nocraft,
noapi = args.noapi,
nohang = args.nohang,
- timeout = args.timeout
+ timeout = args.timeout,
+ logreq = args.logreq,
+ logresp = args.logresp,
+ hexdump = args.hexdump
)
except pathod.PathodError, v:
parser.error(str(v))
@@ -124,14 +127,6 @@ if __name__ == "__main__":
help='Daemonize.'
)
parser.add_argument(
- "-f", dest='logfile', default=None, type=str,
- help='Log file.'
- )
- parser.add_argument(
- "--debug", dest='debug', default=False, action="store_true",
- help='Enable debug output.'
- )
- parser.add_argument(
"-s", dest='ssl', default=False, action="store_true",
help='Serve with SSL.'
)
@@ -167,6 +162,26 @@ if __name__ == "__main__":
"--certfile", dest='ssl_certfile', default=None, type=str,
help='SSL cert file. If not specified, a default cert is used.'
)
+
+
+ group = parser.add_argument_group('Controlling Output')
+ group.add_argument(
+ "-f", dest='logfile', default=None, type=str,
+ help='Log to file.'
+ )
+ group.add_argument(
+ "-q", dest="logreq", action="store_true", default=False,
+ help="Log full request"
+ )
+ group.add_argument(
+ "-r", dest="logresp", action="store_true", default=False,
+ help="Log full response"
+ )
+ group.add_argument(
+ "-x", dest="hexdump", action="store_true", default=False,
+ help="Log request/response in hexdump format"
+ )
+
args = parser.parse_args()
if args.daemonize:
daemonize()