From a77a9c04b737811a5028bfa4bb1707a6a5b846e2 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 2 Nov 2018 00:02:11 +0100 Subject: [PATCH] Missed SSL flag --- platypush/backend/http/__init__.py | 3 ++- platypush/backend/http/static/js/application.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index 3d70c31c..8ecaf09b 100644 --- a/platypush/backend/http/__init__.py +++ b/platypush/backend/http/__init__.py @@ -271,7 +271,8 @@ class HttpBackend(Backend): enabled_plugins[plugin] = conf return render_template('index.html', plugins=enabled_plugins, hidden_plugins=hidden_plugins, - token=Config.get('token'), websocket_port=self.websocket_port) + token=Config.get('token'), websocket_port=self.websocket_port, + has_ssl=self.ssl_cert is not None) @app.route('/widget/', methods=['POST']) diff --git a/platypush/backend/http/static/js/application.js b/platypush/backend/http/static/js/application.js index b8bbe303..9a87e6a1 100644 --- a/platypush/backend/http/static/js/application.js +++ b/platypush/backend/http/static/js/application.js @@ -9,7 +9,7 @@ $(document).ready(function() { var initWebsocket = function() { try { - url_prefix = window.ssl_cert ? 'wss://' : 'ws://'; + url_prefix = window.has_ssl ? 'wss://' : 'ws://'; websocket = new WebSocket(url_prefix + window.location.hostname + ':' + window.websocket_port); } catch (err) { websocket = undefined;