aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-07-18 14:41:08 +0300
committerRblSb <msrblsb@gmail.com>2020-07-18 14:41:08 +0300
commit2f8739d53ac6c90424756eb463d8d82bb8d4bfeb (patch)
tree697a0de8b0832669ebc66589bd95ba5a72db530f
parentedfe4a444eadb3353a850467d8a6bdbf0c5bb5ab (diff)
Mistakes were made
fix reconnection with double colon
-rw-r--r--res/client.js6
-rw-r--r--src/client/Main.hx4
2 files changed, 4 insertions, 6 deletions
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);
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 89a6ac6..31bd580 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -101,10 +101,10 @@ class Main {
}
function openWebSocket(host:String, port:String):Void {
- if (port.length > 0) port = ':$port';
+ final colonPort = port.length > 0 ? ':$port' : port;
var protocol = "ws:";
if (Browser.location.protocol == "https:") protocol = "wss:";
- ws = new WebSocket('$protocol//$host$port');
+ ws = new WebSocket('$protocol//$host$colonPort');
ws.onmessage = onMessage;
ws.onopen = () -> {
serverMessage(1);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage