diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index 3d70c31cae..8ecaf09b24 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 b8bbe3034a..9a87e6a147 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;