From 789ef35bb7b1da6bff1cdf00c6d89548a27c0681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Val=C3=A9rio?= Date: Sun, 27 Jan 2019 13:04:19 +0000 Subject: [PATCH] used websocket protocol should match the http one --- callbacks/static/js/viewer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/callbacks/static/js/viewer.js b/callbacks/static/js/viewer.js index ead0dd8..f080741 100644 --- a/callbacks/static/js/viewer.js +++ b/callbacks/static/js/viewer.js @@ -20,9 +20,10 @@ function setupConnection() { Setup a connection to receive all the information about the webhooks in real-time. */ + let protocol = document.location.protocol == "https:" ? "wss://" : "ws://"; let callbackCode = getCallbackCode(); let webhookSocket = new WebSocket( - "ws://" + window.location.host + "/ws/callback/" + callbackCode + "/" + protocol + window.location.host + "/ws/callback/" + callbackCode + "/" ); webhookSocket.onmessage = function(event) {