diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/Main.hx | 4 |
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); |
