aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/client.js8
-rw-r--r--src/client/Main.hx4
2 files changed, 6 insertions, 6 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);
diff --git a/src/client/Main.hx b/src/client/Main.hx
index c8750ca..89a6ac6 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -48,7 +48,6 @@ class Main {
if (host == "") host = "localhost";
this.host = host;
if (port == null) port = Browser.location.port;
- if (port == "") port = "80";
final defaults:ClientSettings = {
version: SETTINGS_VERSION,
@@ -102,9 +101,10 @@ class Main {
}
function openWebSocket(host:String, port:String):Void {
+ if (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$port');
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