From 3eed774d50db800d42bccc5aa182d885e4886de1 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 2 Nov 2018 00:00:10 +0100 Subject: [PATCH] Added SSL to websockets js code as well --- platypush/backend/http/static/js/application.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platypush/backend/http/static/js/application.js b/platypush/backend/http/static/js/application.js index 8534fe3a..b8bbe303 100644 --- a/platypush/backend/http/static/js/application.js +++ b/platypush/backend/http/static/js/application.js @@ -9,7 +9,8 @@ $(document).ready(function() { var initWebsocket = function() { try { - websocket = new WebSocket('ws://' + window.location.hostname + ':' + window.websocket_port); + url_prefix = window.ssl_cert ? 'wss://' : 'ws://'; + websocket = new WebSocket(url_prefix + window.location.hostname + ':' + window.websocket_port); } catch (err) { websocket = undefined; return;