From d211b92447e25f28e7f9af1e89310b74592479cf Mon Sep 17 00:00:00 2001 From: Nick Steel Date: Tue, 25 Aug 2015 15:50:28 +0100 Subject: [PATCH] Use correct websocket protocol when using websocket_host/port settings --- mopidy_musicbox_webclient/web.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mopidy_musicbox_webclient/web.py b/mopidy_musicbox_webclient/web.py index 5ec3e21..093f4f6 100644 --- a/mopidy_musicbox_webclient/web.py +++ b/mopidy_musicbox_webclient/web.py @@ -39,7 +39,10 @@ class IndexHandler(tornado.web.RequestHandler): port = config['http']['port'] logger.warning('Musicbox websocket_port not specified, ' 'using %s', port) - ws_url = "ws://%s:%d/mopidy/ws" % (host, port) + protocol = 'ws' + if self.request.protocol == 'https': + protocol = 'wss' + ws_url = "%s://%s:%d/mopidy/ws" % (protocol, host, port) self.__dict = { 'version': MusicBoxExtension.version,