Removing SSL config - non HTTPS can't use SSL anyway

This commit is contained in:
James Barnsley
2018-10-04 21:07:25 +13:00
parent 5d827902e4
commit 62fe788395
9 changed files with 14100 additions and 10787 deletions

View File

@ -207,13 +207,15 @@ const MopidyMiddleware = (function(){
switch(action.type){
case 'MOPIDY_CONNECT':
if (socket != null){
socket.close();
}
if (socket != null) socket.close();
store.dispatch({ type: 'MOPIDY_CONNECTING'});
var state = store.getState();
socket = new Mopidy({
webSocketUrl: 'ws'+(state.mopidy.ssl ? 's' : '')+'://'+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'
});