aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/flow.py
diff options
context:
space:
mode:
authorSandor Nemes <snemes@users.noreply.github.com>2016-01-13 15:05:57 +0100
committerSandor Nemes <snemes@users.noreply.github.com>2016-01-13 15:05:57 +0100
commit2753af0ec72e542d5a4dc3e5e200bd1638b2b095 (patch)
tree8968dca61eac1d68288e85d5be1b0c680f015d6c /libmproxy/flow.py
parentfe77dd35c67a0dfbd3004fefe97c689f8cfd3291 (diff)
parentaea3837d4ae637af42f716acb27d7ea8394ece35 (diff)
downloadmitmproxy-2753af0ec72e542d5a4dc3e5e200bd1638b2b095.tar.gz
mitmproxy-2753af0ec72e542d5a4dc3e5e200bd1638b2b095.tar.bz2
mitmproxy-2753af0ec72e542d5a4dc3e5e200bd1638b2b095.zip
Merge branch 'master' into master
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r--libmproxy/flow.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index a2b069ed..f02b5767 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -665,7 +665,7 @@ class FlowMaster(controller.Master):
self.add_event("Script error:\n" + str(e), "error")
script.reloader.unwatch(script_obj)
self.scripts.remove(script_obj)
-
+
def load_script(self, command, use_reloader=False):
"""
Loads a script. Returns an error description if something went
@@ -1066,6 +1066,16 @@ class FlowMaster(controller.Master):
self.stream.fo.close()
self.stream = None
+ def start_stream_to_path(self, path, mode="wb"):
+ path = os.path.expanduser(path)
+ try:
+ f = file(path, mode)
+ self.start_stream(f, None)
+ except IOError as v:
+ return str(v)
+ self.stream_path = path
+
+
def read_flows_from_paths(paths):
"""
Given a list of filepaths, read all flows and return a list of them.