From dbf5c2a481b65c30b64dcd92593183fa195f0588 Mon Sep 17 00:00:00 2001 From: not-nullptr <62841684+not-nullptr@users.noreply.github.com> Date: Sat, 15 Feb 2025 03:17:38 +0000 Subject: [PATCH] feat: protocol detection for wss in vertd --- src/lib/converters/vertd.svelte.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/converters/vertd.svelte.ts b/src/lib/converters/vertd.svelte.ts index d77c3d5..4784237 100644 --- a/src/lib/converters/vertd.svelte.ts +++ b/src/lib/converters/vertd.svelte.ts @@ -141,8 +141,9 @@ export class VertdConverter extends Converter { return new Promise((resolve, reject) => { const apiUrl = Settings.instance.settings.vertdURL; + const protocol = apiUrl.startsWith("https") ? "wss:" : "ws:"; const ws = new WebSocket( - `ws://${apiUrl.replace("http://", "").replace("https://", "")}/api/ws`, + `${protocol}//${apiUrl.replace("http://", "").replace("https://", "")}/api/ws`, ); ws.onopen = () => { const speed = Settings.instance.settings.vertdSpeed;