diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-09-17 13:58:56 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-09-17 13:58:56 +1200 |
commit | b4ecd96beb77a8bae02d82eac174dded198797a3 (patch) | |
tree | 1868202264b5e201338698b76dbed5104448ec28 /web | |
parent | 51db9a5612f0899ed61751dbee3f4e4b19a74ea4 (diff) | |
download | mitmproxy-b4ecd96beb77a8bae02d82eac174dded198797a3.tar.gz mitmproxy-b4ecd96beb77a8bae02d82eac174dded198797a3.tar.bz2 mitmproxy-b4ecd96beb77a8bae02d82eac174dded198797a3.zip |
Introduce short form object state, and connect the ends to send data to web app
Diffstat (limited to 'web')
-rw-r--r-- | web/src/js/connection.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/src/js/connection.js b/web/src/js/connection.js index 0a74ed33..a4369b5a 100644 --- a/web/src/js/connection.js +++ b/web/src/js/connection.js @@ -18,7 +18,15 @@ _Connection.prototype.onopen = function (open) { }; _Connection.prototype.onmessage = function (message) { //AppDispatcher.dispatchServerAction(...); - console.log("onmessage", this, arguments); + var m = JSON.parse(message.data); + switch (m.type){ + case "flow": + console.log("flow", m.data); + break; + case "event": + console.log("event", m.data.message) + break; + } }; _Connection.prototype.onerror = function (error) { console.log("onerror", this, arguments); |