diff --git a/src/js/services/pusher/middleware.js b/src/js/services/pusher/middleware.js index 64990a5b..0cae63d9 100755 --- a/src/js/services/pusher/middleware.js +++ b/src/js/services/pusher/middleware.js @@ -73,7 +73,7 @@ const PusherMiddleware = (function(){ connection.username = connection.username.replace(/\W/g, '') socket = new WebSocket( - 'ws://'+state.mopidy.host+':'+state.mopidy.port+'/iris/ws', + 'ws'+(window.location.protocol === 'https:' ? 's' : '')+'://'+state.mopidy.host+':'+state.mopidy.port+'/iris/ws', [ connection.clientid, connection.connection_id, connection.username ] ); @@ -344,4 +344,4 @@ const PusherMiddleware = (function(){ })(); -export default PusherMiddleware \ No newline at end of file +export default PusherMiddleware