Merge branch 'ssl'

This commit is contained in:
James Barnsley
2017-03-28 08:06:22 +13:00
3 changed files with 5 additions and 4 deletions

View File

@ -153,7 +153,7 @@ const MopidyMiddleware = (function(){
var state = store.getState();
socket = new Mopidy({
webSocketUrl: 'ws://'+state.mopidy.host+':'+state.mopidy.port+'/mopidy/ws',
webSocketUrl: 'ws'+(window.location.protocol === 'https:' ? 's' : '')+'://'+state.mopidy.host+':'+state.mopidy.port+'/mopidy/ws',
callingConvention: 'by-position-or-by-name'
});

View File

@ -15,7 +15,8 @@ export default function reducer(mopidy = {}, action){
case 'MOPIDY_SET_CONFIG':
return Object.assign({}, mopidy, {
host: action.host,
port: action.port
port: action.port,
ssl: action.ssl
});
case 'MOPIDY_CHANGE_TRACK':

View File

@ -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
export default PusherMiddleware