aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-03-08 09:43:48 +0300
committerRblSb <msrblsb@gmail.com>2020-03-08 09:43:48 +0300
commit39e12465aa30c79799e9c443f0fa393a07019cef (patch)
tree678ab49f5766ed24d1211b0aa9394f4291fbffd4 /src/client
parenta156726fd7962dd51886b8ecfb0cfd54ef2343ae (diff)
Use wss protocol on https page
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Main.hx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 918a81a..8edeb8f 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -67,7 +67,9 @@ class Main {
}
function openWebSocket(host:String, port:String):Void {
- ws = new WebSocket('ws://$host:$port');
+ var protocol = "ws:";
+ if (Browser.location.protocol == "https:") protocol = "wss:";
+ 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