diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-11-27 01:40:26 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-11-27 01:40:26 +0100 |
commit | e41c0be293502619b6a072fb9bcd8bbd8694b86a (patch) | |
tree | a13a3f26bfba5fd1f53fbdb10fc08145223af929 /web/src/js/connection.js | |
parent | 38bf34ebd9826c6f69d97906282632fbd5cff06b (diff) | |
download | mitmproxy-e41c0be293502619b6a072fb9bcd8bbd8694b86a.tar.gz mitmproxy-e41c0be293502619b6a072fb9bcd8bbd8694b86a.tar.bz2 mitmproxy-e41c0be293502619b6a072fb9bcd8bbd8694b86a.zip |
format code
Diffstat (limited to 'web/src/js/connection.js')
-rw-r--r-- | web/src/js/connection.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/web/src/js/connection.js b/web/src/js/connection.js index 64d550bf..d511270d 100644 --- a/web/src/js/connection.js +++ b/web/src/js/connection.js @@ -1,20 +1,20 @@ function Connection(url) { - if(url[0] != "/"){ + if (url[0] != "/") { this.url = url; } else { this.url = location.origin.replace("http", "ws") + url; } var ws = new WebSocket(this.url); - ws.onopen = function(){ + ws.onopen = function () { this.onopen.apply(this, arguments); }.bind(this); - ws.onmessage = function(){ + ws.onmessage = function () { this.onmessage.apply(this, arguments); }.bind(this); - ws.onerror = function(){ + ws.onerror = function () { this.onerror.apply(this, arguments); }.bind(this); - ws.onclose = function(){ + ws.onclose = function () { this.onclose.apply(this, arguments); }.bind(this); this.ws = ws; @@ -33,6 +33,6 @@ Connection.prototype.onclose = function (close) { EventLogActions.add_event("WebSocket Connection closed."); console.debug("onclose", this, arguments); }; -Connection.prototype.close = function(){ +Connection.prototype.close = function () { this.ws.close(); };
\ No newline at end of file |