mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-04-13 08:28:32 +00:00
fix(streaming): preserve IP-based URLs when domain is inactive
When a domain is configured but not resolving (DNS not set up, cert not active), stream redirect URLs use the domain causing playback to fail. Now: - StreamRedirector::getStreamingURL() falls back to server_ip when client connects via IP address (HOST is an IP) - DomainResolver::resolve() preserves IP when use_mdomain_in_lists=1 but client accessed via IP address
This commit is contained in:
@@ -50,6 +50,8 @@ class DomainResolver {
|
||||
if (!(strlen($rDomain) > 0 && in_array(strtolower($rDomain), $rResellerDomains))) {
|
||||
if (empty($rServers[$rServerID]['domain_name'])) {
|
||||
$rDomain = escapeshellcmd($rServers[$rServerID]['server_ip']);
|
||||
} else if (filter_var($rDomain, FILTER_VALIDATE_IP)) {
|
||||
$rDomain = escapeshellcmd($rServers[$rServerID]['server_ip']);
|
||||
} else {
|
||||
$rDomain = str_replace(array('http://', '/', 'https://'), '', escapeshellcmd(explode(',', $rServers[$rServerID]['domain_name'])[0]));
|
||||
}
|
||||
|
||||
@@ -185,7 +185,11 @@ class StreamRedirector {
|
||||
if ($rDomain) {
|
||||
$rURL = $rProtocol . '://' . $rDomain . ':' . $rServers[$rServerID][$rProtocol . '_broadcast_port'];
|
||||
} else {
|
||||
$rURL = rtrim($rServers[$rServerID][$rProtocol . '_url'], '/');
|
||||
if (defined('HOST') && strlen(HOST) > 0 && filter_var(HOST, FILTER_VALIDATE_IP)) {
|
||||
$rURL = $rProtocol . '://' . $rServers[$rServerID]['server_ip'] . ':' . $rServers[$rServerID][$rProtocol . '_broadcast_port'];
|
||||
} else {
|
||||
$rURL = rtrim($rServers[$rServerID][$rProtocol . '_url'], '/');
|
||||
}
|
||||
}
|
||||
if ($rServers[$rServerID]['server_type'] == 1 && $rOriginatorID && $rServers[$rOriginatorID]['is_main'] == 0) {
|
||||
$rURL .= '/' . md5($rServerID . '_' . $rOriginatorID . '_' . OPENSSL_EXTRA);
|
||||
|
||||
Reference in New Issue
Block a user