mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
Merge pull request #752 from Cp0204/features-subscription-optimization
update: Support TCP-HTTP sub rules
This commit is contained in:
commit
6c327f9a63
@ -128,6 +128,11 @@ class Clash
|
||||
$array['servername'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ($server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $array['network'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $array['http-opts']['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ($server['network'] === 'ws') {
|
||||
$array['network'] = 'ws';
|
||||
if ($server['networkSettings']) {
|
||||
|
@ -128,6 +128,11 @@ class ClashMeta
|
||||
$array['servername'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ($server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $array['network'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $array['http-opts']['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ($server['network'] === 'ws') {
|
||||
$array['network'] = 'ws';
|
||||
if ($server['networkSettings']) {
|
||||
|
@ -80,6 +80,11 @@ class General
|
||||
$config['sni'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ((string)$server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $config['type'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ((string)$server['network'] === 'ws') {
|
||||
$wsSettings = $server['networkSettings'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];
|
||||
|
@ -68,6 +68,11 @@ class Passwall
|
||||
$config['sni'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ((string)$server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $config['type'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ((string)$server['network'] === 'ws') {
|
||||
$wsSettings = $server['networkSettings'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];
|
||||
|
@ -72,6 +72,11 @@ class SagerNet
|
||||
$config['sni'] = urlencode($tlsSettings['serverName']);
|
||||
}
|
||||
}
|
||||
if ((string)$server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $config['type'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ((string)$server['network'] === 'ws') {
|
||||
$wsSettings = $server['networkSettings'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];
|
||||
|
@ -82,6 +82,15 @@ class Shadowrocket
|
||||
$config['peer'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ($server['network'] === 'tcp') {
|
||||
if ($server['networkSettings']) {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type']) && !empty($tcpSettings['header']['type']))
|
||||
$config['obfs'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0]) && !empty($tcpSettings['header']['request']['path'][0]))
|
||||
$config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
}
|
||||
if ($server['network'] === 'ws') {
|
||||
$config['obfs'] = "websocket";
|
||||
if ($server['networkSettings']) {
|
||||
|
@ -125,6 +125,11 @@ class Stash
|
||||
$array['servername'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ($server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $array['network'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $array['http-opts']['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ($server['network'] === 'ws') {
|
||||
$array['network'] = 'ws';
|
||||
if ($server['networkSettings']) {
|
||||
|
@ -80,6 +80,11 @@ class V2rayN
|
||||
$config['sni'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ((string)$server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $config['type'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ((string)$server['network'] === 'ws') {
|
||||
$wsSettings = $server['networkSettings'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];
|
||||
|
@ -68,6 +68,11 @@ class V2rayNG
|
||||
$config['sni'] = $tlsSettings['serverName'];
|
||||
}
|
||||
}
|
||||
if ((string)$server['network'] === 'tcp') {
|
||||
$tcpSettings = $server['networkSettings'];
|
||||
if (isset($tcpSettings['header']['type'])) $config['type'] = $tcpSettings['header']['type'];
|
||||
if (isset($tcpSettings['header']['request']['path'][0])) $config['path'] = $tcpSettings['header']['request']['path'][0];
|
||||
}
|
||||
if ((string)$server['network'] === 'ws') {
|
||||
$wsSettings = $server['networkSettings'];
|
||||
if (isset($wsSettings['path'])) $config['path'] = $wsSettings['path'];
|
||||
|
Loading…
Reference in New Issue
Block a user