mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-02 07:28:13 -05:00
Compare commits
5 Commits
76df95112c
...
d01699868b
Author | SHA1 | Date | |
---|---|---|---|
|
d01699868b | ||
|
de18cfe596 | ||
|
42542725f7 | ||
|
ab34ef327a | ||
|
60ed240e66 |
@ -194,8 +194,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流控算法
|
||||||
@ -242,10 +240,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') {
|
||||||
|
@ -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'];
|
||||||
}
|
}
|
||||||
|
@ -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';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -310,6 +310,8 @@ class SingBox
|
|||||||
$array['tag'] = $server['name'];
|
$array['tag'] = $server['name'];
|
||||||
$array['type'] = 'hysteria2';
|
$array['type'] = 'hysteria2';
|
||||||
$array['password'] = $password;
|
$array['password'] = $password;
|
||||||
|
$array['up_mbps'] = $user->speed_limit ? min($server['down_mbps'], $user->speed_limit) : $server['down_mbps'];
|
||||||
|
$array['down_mbps'] = $user->speed_limit ? min($server['up_mbps'], $user->speed_limit) : $server['up_mbps'];
|
||||||
|
|
||||||
if ($server['is_obfs']) {
|
if ($server['is_obfs']) {
|
||||||
$array['obfs']['type'] = 'salamander';
|
$array['obfs']['type'] = 'salamander';
|
||||||
|
Loading…
Reference in New Issue
Block a user