mirror of
https://github.com/v2board/v2board.git
synced 2025-02-15 01:40:28 +08:00
Merge pull request #364 from wloot/patch-2
QuantumultX: keep expected behavior for host
This commit is contained in:
commit
79cbe6ce39
@ -33,31 +33,32 @@ class QuantumultX
|
|||||||
];
|
];
|
||||||
|
|
||||||
if ($server['tls']) {
|
if ($server['tls']) {
|
||||||
if ($server['network'] === 'tcp') {
|
if ($server['network'] === 'tcp')
|
||||||
array_push($config, 'obfs=over-tls');
|
array_push($config, 'obfs=over-tls');
|
||||||
} else {
|
|
||||||
array_push($config, 'obfs=wss');
|
|
||||||
}
|
|
||||||
} else if ($server['network'] === 'ws') {
|
|
||||||
array_push($config, 'obfs=ws');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($server['tls']) {
|
|
||||||
if ($server['tlsSettings']) {
|
if ($server['tlsSettings']) {
|
||||||
$tlsSettings = json_decode($server['tlsSettings'], true);
|
$tlsSettings = json_decode($server['tlsSettings'], true);
|
||||||
if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))
|
if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))
|
||||||
array_push($config, 'tls-verification=' . ($tlsSettings['allowInsecure'] ? 'false' : 'true'));
|
array_push($config, 'tls-verification=' . ($tlsSettings['allowInsecure'] ? 'false' : 'true'));
|
||||||
|
if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName']))
|
||||||
|
$host = $tlsSettings['serverName'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($server['network'] === 'ws') {
|
if ($server['network'] === 'ws') {
|
||||||
|
if ($server['tls'])
|
||||||
|
array_push($config, 'obfs=wss');
|
||||||
|
else
|
||||||
|
array_push($config, 'obfs=ws');
|
||||||
if ($server['networkSettings']) {
|
if ($server['networkSettings']) {
|
||||||
$wsSettings = json_decode($server['networkSettings'], true);
|
$wsSettings = json_decode($server['networkSettings'], true);
|
||||||
if (isset($wsSettings['path']) && !empty($wsSettings['path']))
|
if (isset($wsSettings['path']) && !empty($wsSettings['path']))
|
||||||
array_push($config, "obfs-uri={$wsSettings['path']}");
|
array_push($config, "obfs-uri={$wsSettings['path']}");
|
||||||
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
|
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']) && !isset($host))
|
||||||
array_push($config, "obfs-host={$wsSettings['headers']['Host']}");
|
$host = $wsSettings['headers']['Host'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isset($host)) {
|
||||||
|
array_push($config, "obfs-host={$host}");
|
||||||
|
}
|
||||||
|
|
||||||
$uri = implode(',', $config);
|
$uri = implode(',', $config);
|
||||||
$uri .= "\r\n";
|
$uri .= "\r\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user