This commit is contained in:
Yusum 2025-01-14 10:42:46 +01:00 committed by GitHub
commit 2045820c53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 10 deletions

View File

@ -195,8 +195,6 @@ class ClashMeta
$array['server'] = $server['host']; $array['server'] = $server['host'];
$array['port'] = $server['port']; $array['port'] = $server['port'];
$array['uuid'] = $password; $array['uuid'] = $password;
$array['alterId'] = 0;
$array['cipher'] = 'auto';
$array['udp'] = true; $array['udp'] = true;
// XTLS流控算法 // XTLS流控算法
@ -243,10 +241,8 @@ class ClashMeta
$array['ws-opts']['path'] = $wsSettings['path']; $array['ws-opts']['path'] = $wsSettings['path'];
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host'])) if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
$array['ws-opts']['headers'] = ['Host' => $wsSettings['headers']['Host']]; $array['ws-opts']['headers'] = ['Host' => $wsSettings['headers']['Host']];
if (isset($wsSettings['path']) && !empty($wsSettings['path'])) $array['ws-opts']['max-early-data'] = 2560;
$array['ws-path'] = $wsSettings['path']; $array['ws-opts']['early-data-header-name'] = 'Sec-WebSocket-Protocol';
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
$array['ws-headers'] = ['Host' => $wsSettings['headers']['Host']];
} }
} }
if ($server['network'] === 'grpc') { if ($server['network'] === 'grpc') {

View File

@ -190,7 +190,7 @@ class Shadowrocket
if ($server['network_settings']) { if ($server['network_settings']) {
$wsSettings = $server['network_settings']; $wsSettings = $server['network_settings'];
if (isset($wsSettings['path']) && !empty($wsSettings['path'])) if (isset($wsSettings['path']) && !empty($wsSettings['path']))
$config['path'] = $wsSettings['path']; $config['path'] = $wsSettings['path'] . '?ed=2560';
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host'])) if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
$config['obfsParam'] = $wsSettings['headers']['Host']; $config['obfsParam'] = $wsSettings['headers']['Host'];
} }

View File

@ -149,7 +149,7 @@ class SingBox
$array['transport']['path'] = $wsSettings['path']; $array['transport']['path'] = $wsSettings['path'];
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host'])) if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
$array['transport']['headers'] = ['Host' => array($wsSettings['headers']['Host'])]; $array['transport']['headers'] = ['Host' => array($wsSettings['headers']['Host'])];
$array['transport']['max_early_data'] = 2048; $array['transport']['max_early_data'] = 2560;
$array['transport']['early_data_header_name'] = 'Sec-WebSocket-Protocol'; $array['transport']['early_data_header_name'] = 'Sec-WebSocket-Protocol';
} }
} }
@ -217,7 +217,7 @@ class SingBox
$array['transport']['path'] = $wsSettings['path']; $array['transport']['path'] = $wsSettings['path'];
if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host'])) if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host']))
$array['transport']['headers'] = ['Host' => array($wsSettings['headers']['Host'])]; $array['transport']['headers'] = ['Host' => array($wsSettings['headers']['Host'])];
$array['transport']['max_early_data'] = 2048; $array['transport']['max_early_data'] = 2560;
$array['transport']['early_data_header_name'] = 'Sec-WebSocket-Protocol'; $array['transport']['early_data_header_name'] = 'Sec-WebSocket-Protocol';
} }
} }
@ -272,7 +272,7 @@ class SingBox
if (isset($server['network_settings']['headers']['Host'])) { if (isset($server['network_settings']['headers']['Host'])) {
$array['transport']['headers'] = ['Host' => array($server['network_settings']['headers']['Host'])]; $array['transport']['headers'] = ['Host' => array($server['network_settings']['headers']['Host'])];
} }
$array['transport']['max_early_data'] = 2048; $array['transport']['max_early_data'] = 2560;
$array['transport']['early_data_header_name'] = 'Sec-WebSocket-Protocol'; $array['transport']['early_data_header_name'] = 'Sec-WebSocket-Protocol';
} }
} }