From 2f8739d53ac6c90424756eb463d8d82bb8d4bfeb Mon Sep 17 00:00:00 2001 From: RblSb Date: Sat, 18 Jul 2020 14:41:08 +0300 Subject: Mistakes were made fix reconnection with double colon --- res/client.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'res') diff --git a/res/client.js b/res/client.js index 5370c20..73c0671 100644 --- a/res/client.js +++ b/res/client.js @@ -977,14 +977,12 @@ client_Main.prototype = { } ,openWebSocket: function(host,port) { var _gthis = this; - if(port.length > 0) { - port = ":" + port; - } + var colonPort = port.length > 0 ? ":" + port : port; var protocol = "ws:"; if($global.location.protocol == "https:") { protocol = "wss:"; } - this.ws = new WebSocket("" + protocol + "//" + host + port); + this.ws = new WebSocket("" + protocol + "//" + host + colonPort); this.ws.onmessage = $bind(this,this.onMessage); this.ws.onopen = function() { _gthis.serverMessage(1); -- cgit v1.2.3