兼容新老版本clash ws模式设定 (#212)

* Add ws-headers check 兼容新老版本clash

Co-authored-by: ZBrettonYe <ZBrettonYe@users.noreply.github.com>
This commit is contained in:
gosip443
2022-01-26 21:37:59 +08:00
committed by GitHub
parent f67bcf623d
commit 83f82cfbee

View File

@@ -60,6 +60,12 @@ class Clash
$array['network'] = $server['v2_net'];
if ($server['v2_net'] === 'ws') {
$array['ws-opts'] = [];
$array['ws-opts']['path'] = $server['v2_path'];
if ($server['v2_host']) {
$array['ws-opts']['headers'] = ['Host' => $server['v2_host']];
}
// TODO: 2022.06.01 remove it
$array['ws-path'] = $server['v2_path'];
if ($server['v2_host']) {
$array['ws-headers'] = ['Host' => $server['v2_host']];