From 5b21f48810f608bcb0649dbb70a0a9d82778d9b5 Mon Sep 17 00:00:00 2001 From: Eraac Date: Sun, 5 Mar 2017 15:05:03 +0100 Subject: use wss:// on secure connection --- tipboard/static/js/tipboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tipboard/static/js/tipboard.js b/tipboard/static/js/tipboard.js index 00c89c5..cc43a60 100644 --- a/tipboard/static/js/tipboard.js +++ b/tipboard/static/js/tipboard.js @@ -523,8 +523,11 @@ var renderersSwapper = new RenderersSwapper(); return; // the rest will be handled in onClose() } console.log("Initializing a new Web socket manager."); + + var protocol = window.location.protocol === "https:" ? "wss://" : "ws://"; + this.websocket = new WebSocket( - "ws://" + window.location.host + "/communication/websocket" + protocol + window.location.host + "/communication/websocket" ); this.websocket.onopen = function(evt) { Tipboard.WebSocketManager.onOpen(evt); -- cgit v1.2.3