Skip to content

Commit b8afb37

Browse files
authored
Merge pull request #42 from piotrpdev/OKO-113-WSS
2 parents 62d736c + 00eef58 commit b8afb37

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

frontend/src/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
6666
if ($socket != null) return;
6767
68-
$socket = new WebSocket(`ws://${window.location.host}/api/ws`);
68+
let wsProtocol = window.location.protocol === "https:" ? "wss" : "ws";
69+
70+
$socket = new WebSocket(`${wsProtocol}://${window.location.host}/api/ws`);
6971
$socket?.addEventListener("open", onOpen);
7072
})();
7173

0 commit comments

Comments
 (0)