diff --git a/frontend.tsx b/frontend.tsx index 8c84637..4182236 100644 --- a/frontend.tsx +++ b/frontend.tsx @@ -358,7 +358,8 @@ function App() { const mainRef = useRef(null); useEffect(() => { - const wsUrl = `ws://${window.location.host}/ws`; + const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:"; + const wsUrl = `${wsProtocol}//${window.location.host}/ws`; let ws: WebSocket; let reconnectTimer: ReturnType;