aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
parent3453b6e87516d0945ece046f03cd442ce6826763 (diff)
Fix wss connection on Heroku
closes #2
Diffstat (limited to 'src')
-rw-r--r--src/client/Main.hx4
1 files changed, 2 insertions, 2 deletions
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