From 2509842157db451299a187ae9d48db53a6433d1c Mon Sep 17 00:00:00 2001 From: core Date: Sat, 13 May 2023 20:42:17 -0400 Subject: [PATCH] dont try to connect to ws://https:// - use wss:// when API tells us to --- client/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/index.html b/client/index.html index e1d8d99b6a9c5e7286ae1cea5747181a591e834c..f2425884f11697e2ae21fdf3b3ab0dc05ad525f4 100644 --- a/client/index.html +++ b/client/index.html @@ -46,7 +46,12 @@ } function server_url_to_gateway_url(server) { - return "ws://" + server + "/ws" + let url = new URL(server); + if (url.protocol === "https:") { + return "wss://" + url.host + "/ws"; + } else { + return "ws://" + url.host + "/ws"; + } } function load_server(server) {