diff options
Diffstat (limited to 'libmproxy/dump.py')
-rw-r--r-- | libmproxy/dump.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py index 72ab58a3..ccb2b5b5 100644 --- a/libmproxy/dump.py +++ b/libmproxy/dump.py @@ -10,12 +10,12 @@ class DumpError(Exception): pass class Options(object): attributes = [ "app", - "app_external", "app_host", "app_port", "anticache", "anticomp", "client_replay", + "filtstr", "flow_detail", "keepserving", "kill", @@ -34,6 +34,8 @@ class Options(object): "stream_large_bodies", "verbosity", "wfile", + "replay_ignore_content", + "replay_ignore_params", ] def __init__(self, **kwargs): for k, v in kwargs.items(): @@ -62,19 +64,21 @@ def str_request(f, showhost): class DumpMaster(flow.FlowMaster): - def __init__(self, server, options, filtstr, outfile=sys.stdout): + def __init__(self, server, options, outfile=sys.stdout): flow.FlowMaster.__init__(self, server, flow.State()) self.outfile = outfile self.o = options self.anticache = options.anticache self.anticomp = options.anticomp self.showhost = options.showhost + self.replay_ignore_params = options.replay_ignore_params + self.replay_ignore_content = options.replay_ignore_content self.refresh_server_playback = options.refresh_server_playback self.set_stream_large_bodies(options.stream_large_bodies) - if filtstr: - self.filt = filt.parse(filtstr) + if options.filtstr: + self.filt = filt.parse(options.filtstr) else: self.filt = None @@ -106,7 +110,9 @@ class DumpMaster(flow.FlowMaster): self._readflow(options.server_replay), options.kill, options.rheaders, not options.keepserving, - options.nopop + options.nopop, + options.replay_ignore_params, + options.replay_ignore_content ) if options.client_replay: @@ -134,7 +140,7 @@ class DumpMaster(flow.FlowMaster): self.add_event("Flow file corrupted. Stopped loading.", "error") if self.o.app: - self.start_app(self.o.app_host, self.o.app_port, self.o.app_external) + self.start_app(self.o.app_host, self.o.app_port) def _readflow(self, path): path = os.path.expanduser(path) @@ -197,7 +203,9 @@ class DumpMaster(flow.FlowMaster): print >> self.outfile, str_request(f, self.showhost) print >> self.outfile, self.indent(4, f.request.headers) if utils.isBin(f.request.content): - print >> self.outfile, self.indent(4, netlib.utils.hexdump(f.request.content)) + d = netlib.utils.hexdump(f.request.content) + d = "\n".join("%s\t%s %s"%i for i in d) + print >> self.outfile, self.indent(4, d) elif f.request.content: print >> self.outfile, self.indent(4, f.request.content) print >> self.outfile |