diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-17 17:30:19 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-17 17:30:19 +0200 |
commit | 102bd075689892b06765fb857c89604fe9cf33e5 (patch) | |
tree | 6782d4ee795337204d29a873e7854d6e426574df /libmproxy/web/__init__.py | |
parent | 8245dd19f4f2f4cdd74a6fdf9b5e051c2cd2fac6 (diff) | |
download | mitmproxy-102bd075689892b06765fb857c89604fe9cf33e5.tar.gz mitmproxy-102bd075689892b06765fb857c89604fe9cf33e5.tar.bz2 mitmproxy-102bd075689892b06765fb857c89604fe9cf33e5.zip |
implement FlowStore basics
Diffstat (limited to 'libmproxy/web/__init__.py')
-rw-r--r-- | libmproxy/web/__init__.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libmproxy/web/__init__.py b/libmproxy/web/__init__.py index 83a7bde4..c7e0d20d 100644 --- a/libmproxy/web/__init__.py +++ b/libmproxy/web/__init__.py @@ -61,6 +61,8 @@ class WebMaster(flow.FlowMaster): self.app = app.Application(self.options.wdebug) flow.FlowMaster.__init__(self, server, WebState()) + self.last_log_id = 0 + def tick(self): flow.FlowMaster.tick(self, self.masterq, timeout=0) @@ -81,27 +83,30 @@ class WebMaster(flow.FlowMaster): self.shutdown() def handle_request(self, f): - app.ClientConnection.broadcast("flow", f.get_state(True)) + app.ClientConnection.broadcast("add_flow", f.get_state(True)) flow.FlowMaster.handle_request(self, f) if f: f.reply() return f def handle_response(self, f): - app.ClientConnection.broadcast("flow", f.get_state(True)) + s = f.get_state(True) + app.ClientConnection.broadcast("update_flow", f.get_state(True)) flow.FlowMaster.handle_response(self, f) if f: f.reply() return f def handle_error(self, f): - app.ClientConnection.broadcast("flow", f.get_state(True)) + app.ClientConnection.broadcast("update_flow", f.get_state(True)) flow.FlowMaster.handle_error(self, f) return f def handle_log(self, l): + self.last_log_id += 1 app.ClientConnection.broadcast( "add_event", { + "id": self.last_log_id, "message": l.msg, "level": l.level } |