From b0a278a5b17ba0b98c5f3a25272b78e79b71ae30 Mon Sep 17 00:00:00 2001 From: ajuvercr Date: Sun, 29 Mar 2020 20:39:45 +0200 Subject: [PATCH] wss sucks over nginx --- backend/templates/debug.html.tera | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/templates/debug.html.tera b/backend/templates/debug.html.tera index 9e96d2c..2c82be5 100644 --- a/backend/templates/debug.html.tera +++ b/backend/templates/debug.html.tera @@ -91,8 +91,8 @@ const network = new vis.Network(container, data, options); - - var ws = new WebSocket(`${window.location.protocol.startsWith("https") ? 'wss' : 'ws'}://${window.location.hostname}:3012`); + const secure = window.location.protocol.startsWith("https"); + var ws = new WebSocket(`${secure ? 'wss' : 'ws'}://${window.location.hostname}${secure ? "/websocket" : ":3012"}`); ws.onmessage = function (event) { handle_event(JSON.parse(event.data)); };