aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author✪ vi4m Marcin Kliks <vi4m@users.noreply.github.com>2017-03-06 01:38:32 +0100
committerGitHub <noreply@github.com>2017-03-06 01:38:32 +0100
commit4f071853f197406b3f84c3cf124fc87b879e8ea4 (patch)
tree37e1994b93baecaf19a151441a857f6a445810be
parent3923c2bfe9c0dfa998c6ec76dbb92cda5effcd7b (diff)
parent5b21f48810f608bcb0649dbb70a0a9d82778d9b5 (diff)
downloadtipboard-4f071853f197406b3f84c3cf124fc87b879e8ea4.tar.gz
tipboard-4f071853f197406b3f84c3cf124fc87b879e8ea4.tar.bz2
tipboard-4f071853f197406b3f84c3cf124fc87b879e8ea4.zip
Merge pull request #47 from Eraac/fix-websocket-ssl
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);