From a8fafd9157d5d7460ff2bedb34eeac42f23fba86 Mon Sep 17 00:00:00 2001 From: Alexandre Genon Date: Tue, 20 Jun 2023 21:38:04 +0200 Subject: [PATCH] Support of Websocket over https (wss protocol) --- .../src/main/kotlin/be/aufildemescoutures/frontend/Client.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/main/kotlin/be/aufildemescoutures/frontend/Client.kt b/frontend/src/main/kotlin/be/aufildemescoutures/frontend/Client.kt index ca0484d..d2866a4 100644 --- a/frontend/src/main/kotlin/be/aufildemescoutures/frontend/Client.kt +++ b/frontend/src/main/kotlin/be/aufildemescoutures/frontend/Client.kt @@ -76,7 +76,7 @@ private fun defineServerConfig(): ServerConfig { val webPackMode = js("ENV_WEBPACK_MODE") console.log("Webpack mode is $webPackMode") return if ("production".equals(webPackMode as? String, ignoreCase = true)) { - val wsProtocol = if("https" == window.location.protocol){ + val wsProtocol = if(window.location.protocol.startsWith("https",true)){ "wss://" } else { "ws://"