From 1ac276d04b72d47e2db89545715cb699ef182c96 Mon Sep 17 00:00:00 2001 From: Jailson Dias Date: Mon, 17 Apr 2017 20:19:24 -0300 Subject: [PATCH] Colocando o suporte para websocket com http e https --- amadeus/static/js/socket.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amadeus/static/js/socket.js b/amadeus/static/js/socket.js index 6bf982f..60de4ec 100644 --- a/amadeus/static/js/socket.js +++ b/amadeus/static/js/socket.js @@ -4,7 +4,8 @@ if (("Notification" in window)) { } } -socket = new WebSocket("wss://" + window.location.host + "/"); +var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws"; +socket = new WebSocket(ws_scheme + "://" + window.location.host + "/"); socket.onmessage = function(e) { content = JSON.parse(e.data); -- libgit2 0.21.2