update sample html to use wss in case of https

This commit is contained in:
Chris Margach
2025-04-10 13:46:52 +09:00
parent 02de5993e6
commit d53b7a323a

View File

@@ -321,7 +321,7 @@
const host = window.location.hostname || "localhost";
const port = window.location.port || "8000";
const defaultWebSocketUrl = `ws://${host}:${port}/asr`;
const defaultWebSocketUrl = `${window.location.protocol === "https:" ? "wss" : "ws"}://${host}:${port}/asr`;
websocketInput.value = defaultWebSocketUrl;
websocketUrl = defaultWebSocketUrl;