mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-11 15:03:24 -05:00
[htdocs] admin web interface: use wss:// if connection is over https
This commit is contained in:
parent
0da24a3f90
commit
54d2bdd390
@ -130,7 +130,13 @@ var app = new Vue({
|
||||
console.log('Websocket disabled');
|
||||
return;
|
||||
}
|
||||
var socket = new WebSocket('ws://' + document.domain + ':' + this.config.websocket_port, 'notify');
|
||||
|
||||
var protocol = 'ws://'
|
||||
if (window.location.protocol === 'https:') {
|
||||
protocol = 'wss://'
|
||||
}
|
||||
|
||||
var socket = new WebSocket(protocol + document.domain + ':' + this.config.websocket_port, 'notify');
|
||||
const vm = this;
|
||||
socket.onopen = function() {
|
||||
socket.send(JSON.stringify({ notify: ['update', 'pairing', 'spotify', 'lastfm', 'outputs']}));
|
||||
|
Loading…
Reference in New Issue
Block a user