aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-07-12 21:07:10 +0300
committerRblSb <msrblsb@gmail.com>2020-07-12 21:07:50 +0300
commitedfe4a444eadb3353a850467d8a6bdbf0c5bb5ab (patch)
tree10a9740f204a337faebb4722d84d542f162b4bfd /res
parent3453b6e87516d0945ece046f03cd442ce6826763 (diff)
Fix wss connection on Heroku
closes #2
Diffstat (limited to 'res')
-rw-r--r--res/client.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/res/client.js b/res/client.js
index 6b196b4..5370c20 100644
--- a/res/client.js
+++ b/res/client.js
@@ -930,9 +930,6 @@ var client_Main = function(host,port) {
if(port == null) {
port = $global.location.port;
}
- if(port == "") {
- port = "80";
- }
client_Settings.init({ version : 2, name : "", hash : "", isExtendedPlayer : false, playerSize : 1, chatSize : 300, synchThreshold : 2, isSwapped : false, isUserListHidden : true, latestLinks : [], hotkeysEnabled : true},$bind(this,this.settingsPatcher));
this.settings = client_Settings.read();
this.initListeners();
@@ -980,11 +977,14 @@ client_Main.prototype = {
}
,openWebSocket: function(host,port) {
var _gthis = this;
+ if(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 + port);
this.ws.onmessage = $bind(this,this.onMessage);
this.ws.onopen = function() {
_gthis.serverMessage(1);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage