aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEraac <kevin@labesse.me>2017-03-05 15:05:03 +0100
committerEraac <kevin@labesse.me>2017-03-05 15:05:03 +0100
commit5b21f48810f608bcb0649dbb70a0a9d82778d9b5 (patch)
tree37e1994b93baecaf19a151441a857f6a445810be
parent3923c2bfe9c0dfa998c6ec76dbb92cda5effcd7b (diff)
downloadtipboard-5b21f48810f608bcb0649dbb70a0a9d82778d9b5.tar.gz
tipboard-5b21f48810f608bcb0649dbb70a0a9d82778d9b5.tar.bz2
tipboard-5b21f48810f608bcb0649dbb70a0a9d82778d9b5.zip
use wss:// on secure connection
-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);