From fc23ce2fca20d8aa7be8ca150e43f50b109daa9c Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 27 Nov 2024 14:56:34 +0000 Subject: [PATCH] fix: correct WebSocket URL scheme for HTTPS to use wss instead of ws --- src/zhurnal/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zhurnal/app.py b/src/zhurnal/app.py index dbe5942..9c6679e 100644 --- a/src/zhurnal/app.py +++ b/src/zhurnal/app.py @@ -139,7 +139,7 @@ index_html = """ } document.addEventListener("DOMContentLoaded", () => { - let url = (window.location.protocol == 'http' ? 'ws://': 'ws:///') + window.location.host + "/ws" + let url = (window.location.protocol == 'http' ? 'ws://': 'wss://') + window.location.host + "/ws" const ws = new WebSocket(url); const messagesDiv = document.getElementById("messages"); ws.onmessage = (event) => {