From 2f8739d53ac6c90424756eb463d8d82bb8d4bfeb Mon Sep 17 00:00:00 2001 From: RblSb Date: Sat, 18 Jul 2020 14:41:08 +0300 Subject: Mistakes were made fix reconnection with double colon --- src/client/Main.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/Main.hx b/src/client/Main.hx index 89a6ac6..31bd580 100644 --- a/src/client/Main.hx +++ b/src/client/Main.hx @@ -101,10 +101,10 @@ class Main { } function openWebSocket(host:String, port:String):Void { - if (port.length > 0) port = ':$port'; + final colonPort = 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$colonPort'); ws.onmessage = onMessage; ws.onopen = () -> { serverMessage(1); -- cgit v1.2.3