If HTTPS then WSS

This commit is contained in:
James Barnsley
2017-03-27 21:36:33 +13:00
parent 11198f18c7
commit d85f3012f4
3 changed files with 15 additions and 3 deletions

View File

@ -152,8 +152,13 @@ const MopidyMiddleware = (function(){
var state = store.getState();
if (window.location.protocol == 'https'){
var protocol = 'wss'
} else {
var protocol = 'ws'
}
socket = new Mopidy({
webSocketUrl: 'ws://'+state.mopidy.host+':'+state.mopidy.port+'/mopidy/ws',
webSocketUrl: protocol+'://'+state.mopidy.host+':'+state.mopidy.port+'/mopidy/ws',
callingConvention: 'by-position-or-by-name'
});