From 33fa49277a821b9d38e8c9bf0bcf2adcfa2f6f04 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 15 Feb 2016 14:58:46 +0100 Subject: move mitmproxy --- web/src/js/connection.js | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 web/src/js/connection.js (limited to 'web/src/js/connection.js') diff --git a/web/src/js/connection.js b/web/src/js/connection.js deleted file mode 100644 index 5e229b6e..00000000 --- a/web/src/js/connection.js +++ /dev/null @@ -1,29 +0,0 @@ - -var actions = require("./actions.js"); -var AppDispatcher = require("./dispatcher.js").AppDispatcher; - -function Connection(url) { - if (url[0] === "/") { - url = location.origin.replace("http", "ws") + url; - } - - var ws = new WebSocket(url); - ws.onopen = function () { - actions.ConnectionActions.open(); - }; - ws.onmessage = function (message) { - var m = JSON.parse(message.data); - AppDispatcher.dispatchServerAction(m); - }; - ws.onerror = function () { - actions.ConnectionActions.error(); - actions.EventLogActions.add_event("WebSocket connection error."); - }; - ws.onclose = function () { - actions.ConnectionActions.close(); - actions.EventLogActions.add_event("WebSocket connection closed."); - }; - return ws; -} - -module.exports = Connection; \ No newline at end of file -- cgit v1.2.3