Set Mopidy WebSocket URL according to document location
for correct nginx folder redirection
This commit is contained in:
parent
7c42146b16
commit
46b6983f72
@ -565,7 +565,10 @@ $(document).ready(function (event) {
|
|||||||
$(window).resize(resizeMb).resize()
|
$(window).resize(resizeMb).resize()
|
||||||
|
|
||||||
// Connect to server
|
// Connect to server
|
||||||
var websocketUrl = $(document.body).data('websocket-url')
|
//var websocketUrl = $(document.body).data('websocket-url')
|
||||||
|
var wsProto = "https:" === window.location.protocol ? "wss://" : "ws://";
|
||||||
|
var websocketUrl = wsProto + window.location.hostname +
|
||||||
|
window.location.pathname.replace("musicbox_webclient", "mopidy").match(/.*\//) + "ws";
|
||||||
var connectOptions = {callingConvention: 'by-position-or-by-name'}
|
var connectOptions = {callingConvention: 'by-position-or-by-name'}
|
||||||
if (websocketUrl) {
|
if (websocketUrl) {
|
||||||
connectOptions['webSocketUrl'] = websocketUrl
|
connectOptions['webSocketUrl'] = websocketUrl
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user