User-defined SSL settings; Git.io hosted app

This commit is contained in:
James Barnsley
2017-11-27 16:38:33 +13:00
parent 34acda244f
commit f1408290ae
12 changed files with 102 additions and 28 deletions

View File

@ -63,7 +63,8 @@ const localstorageMiddleware = (function(){
'mopidy',
{
host: action.config.host,
port: action.config.port
port: action.config.port,
ssl: action.config.ssl
}
);
break;

View File

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

View File

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