mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-25 13:43:18 -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');
|
console.log('Websocket disabled');
|
||||||
return;
|
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;
|
const vm = this;
|
||||||
socket.onopen = function() {
|
socket.onopen = function() {
|
||||||
socket.send(JSON.stringify({ notify: ['update', 'pairing', 'spotify', 'lastfm', 'outputs']}));
|
socket.send(JSON.stringify({ notify: ['update', 'pairing', 'spotify', 'lastfm', 'outputs']}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user