mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-05 03:58:39 +00:00
兼容新老版本clash ws模式设定 (#212)
* Add ws-headers check 兼容新老版本clash Co-authored-by: ZBrettonYe <ZBrettonYe@users.noreply.github.com>
This commit is contained in:
@@ -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']];
|
||||
|
||||
Reference in New Issue
Block a user