aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/web/__init__.py
diff options
context:
space:
mode:
authorJim Shaver <dcypherd@gmail.com>2015-06-23 21:48:05 -0500
committerJim Shaver <dcypherd@gmail.com>2015-06-23 21:48:05 -0500
commit080e4534253338c94e6d8c86cb3679ff15410f85 (patch)
tree6322fb822332b4135f0ff14de8c2d7137016f734 /libmproxy/web/__init__.py
parentdb5c0b210b0133d7cd58124c727dbc24480e2568 (diff)
parent074d8d7c7463cdb1f0a90e165a4b3ada3554b4c2 (diff)
downloadmitmproxy-080e4534253338c94e6d8c86cb3679ff15410f85.tar.gz
mitmproxy-080e4534253338c94e6d8c86cb3679ff15410f85.tar.bz2
mitmproxy-080e4534253338c94e6d8c86cb3679ff15410f85.zip
Merge branch 'master' into hardfailvenv
Conflicts: dev
Diffstat (limited to 'libmproxy/web/__init__.py')
-rw-r--r--libmproxy/web/__init__.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/libmproxy/web/__init__.py b/libmproxy/web/__init__.py
index 173ddf9f..a0af7315 100644
--- a/libmproxy/web/__init__.py
+++ b/libmproxy/web/__init__.py
@@ -79,6 +79,7 @@ class WebState(flow.State):
data=[]
)
+
class Options(object):
attributes = [
"app",
@@ -128,11 +129,13 @@ class WebMaster(flow.FlowMaster):
if options.rfile:
try:
self.load_flows_file(options.rfile)
- except flow.FlowReadError, v:
+ except flow.FlowReadError as v:
self.add_event(
- "Could not read flow file: %s"%v,
+ "Could not read flow file: %s" % v,
"error"
)
+ if self.options.app:
+ self.start_app(self.options.app_host, self.options.app_port)
def tick(self):
flow.FlowMaster.tick(self, self.masterq, timeout=0)
@@ -154,7 +157,8 @@ class WebMaster(flow.FlowMaster):
self.shutdown()
def _process_flow(self, f):
- if self.state.intercept and self.state.intercept(f) and not f.request.is_replay:
+ if self.state.intercept and self.state.intercept(
+ f) and not f.request.is_replay:
f.intercept(self)
else:
f.reply()
@@ -173,4 +177,4 @@ class WebMaster(flow.FlowMaster):
def add_event(self, e, level="info"):
super(WebMaster, self).add_event(e, level)
- self.state.add_event(e, level) \ No newline at end of file
+ self.state.add_event(e, level)