aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tipboard/static/js/tipboard.js5
1 files changed, 4 insertions, 1 deletions
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);