mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
quickShell support for ws_proxy_url
This commit is contained in:
parent
5cf7a0026e
commit
0d67d23cb6
@ -74,10 +74,11 @@ function quickShell()
|
|||||||
config_update_value('ws_port', 8080);
|
config_update_value('ws_port', 8080);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['ws_url']) === false) {
|
if (isset($config['ws_proxy_url']) === false) {
|
||||||
$ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port'];
|
$ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port'];
|
||||||
} else {
|
} else {
|
||||||
$ws_url = $config['ws_url'];
|
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
|
||||||
|
$ws_url = 'ws://'.$matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gotty settings. Internal communication (WS).
|
// Gotty settings. Internal communication (WS).
|
||||||
@ -196,7 +197,8 @@ function quickShell()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$test = file_get_contents($ws_url);
|
// If rediretion is enabled, we will try to connect to http:// or https:// endpoint.
|
||||||
|
$test = get_headers($ws_url);
|
||||||
if ($test === false) {
|
if ($test === false) {
|
||||||
if (empty($wiz) === true) {
|
if (empty($wiz) === true) {
|
||||||
$wiz = new Wizard();
|
$wiz = new Wizard();
|
||||||
@ -236,9 +238,8 @@ function quickShell()
|
|||||||
$new .= " + window.location.host + ':";
|
$new .= " + window.location.host + ':";
|
||||||
$new .= $config['ws_port'].'/'.$method."';";
|
$new .= $config['ws_port'].'/'.$method."';";
|
||||||
} else {
|
} else {
|
||||||
$new = "var url = (httpsEnabled ? 'wss://' : 'ws://') + ";
|
$new = "var url = '";
|
||||||
$new .= 'window.location.host + ';
|
$new .= $config['ws_proxy_url'].'/'.$method."';";
|
||||||
$new .= "'".$config['ws_proxy_url'].'/'.$method."';";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update url.
|
// Update url.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user