diff options
Diffstat (limited to 'mitmproxy/tools/web/master.py')
-rw-r--r-- | mitmproxy/tools/web/master.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py index 2f1fd4e3..e35815ad 100644 --- a/mitmproxy/tools/web/master.py +++ b/mitmproxy/tools/web/master.py @@ -21,7 +21,8 @@ class Stop(Exception): class _WebState(): def add_log(self, e, level): - self._last_event_id += 1 + # server-side log ids are odd + self._last_event_id += 2 entry = { "id": self._last_event_id, "message": e, @@ -29,7 +30,7 @@ class _WebState(): } self.events.append(entry) app.ClientConnection.broadcast( - type="UPDATE_EVENTLOG", + resource="events", cmd="add", data=entry ) @@ -38,9 +39,8 @@ class _WebState(): super().clear() self.events.clear() app.ClientConnection.broadcast( - type="UPDATE_EVENTLOG", - cmd="reset", - data=[] + resource="events", + cmd="reset" ) @@ -113,28 +113,28 @@ class WebMaster(master.Master): def _sig_add(self, view, flow): app.ClientConnection.broadcast( - type="UPDATE_FLOWS", + resource="flows", cmd="add", data=app.convert_flow_to_json_dict(flow) ) def _sig_update(self, view, flow): app.ClientConnection.broadcast( - type="UPDATE_FLOWS", + resource="flows", cmd="update", data=app.convert_flow_to_json_dict(flow) ) def _sig_remove(self, view, flow): app.ClientConnection.broadcast( - type="UPDATE_FLOWS", + resource="flows", cmd="remove", data=dict(id=flow.id) ) def _sig_refresh(self, view): app.ClientConnection.broadcast( - type="UPDATE_FLOWS", + resource="flows", cmd="reset" ) |