Commit 1ac276d04b72d47e2db89545715cb699ef182c96
1 parent
d9d031bb
Exists in
master
and in
2 other branches
Colocando o suporte para websocket com http e https
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
amadeus/static/js/socket.js
... | ... | @@ -4,7 +4,8 @@ if (("Notification" in window)) { |
4 | 4 | } |
5 | 5 | } |
6 | 6 | |
7 | -socket = new WebSocket("wss://" + window.location.host + "/"); | |
7 | +var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws"; | |
8 | +socket = new WebSocket(ws_scheme + "://" + window.location.host + "/"); | |
8 | 9 | |
9 | 10 | socket.onmessage = function(e) { |
10 | 11 | content = JSON.parse(e.data); | ... | ... |