aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/dump.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/dump.py')
-rw-r--r--libmproxy/dump.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py
index 3e645167..ce9c2b50 100644
--- a/libmproxy/dump.py
+++ b/libmproxy/dump.py
@@ -14,6 +14,7 @@ class Options(object):
"refresh_server_playback",
"request_script",
"response_script",
+ "rfile",
"rheaders",
"server_replay",
"stickycookie",
@@ -84,6 +85,15 @@ class DumpMaster(flow.FlowMaster):
not options.keepserving
)
+ if options.rfile:
+ path = os.path.expanduser(options.rfile)
+ try:
+ f = file(path, "r")
+ freader = flow.FlowReader(f)
+ except IOError, v:
+ raise DumpError(v.strerror)
+ self.load_flows(freader)
+
if options.client_replay:
self.start_client_playback(
self._readflow(options.client_replay),
@@ -189,6 +199,8 @@ class DumpMaster(flow.FlowMaster):
# begin nocover
def run(self):
+ if self.o.rfile and not self.o.keepserving:
+ return
try:
return flow.FlowMaster.run(self)
except BaseException, v: