mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-03-12 07:48:14 -04:00
fix: Remove forced direct IP rule for nodes
This commit is contained in:
parent
c45ba9a34d
commit
e297cb9b77
@ -119,13 +119,13 @@ class Clash implements ProtocolInterface
|
|||||||
if ($subsDomain) {
|
if ($subsDomain) {
|
||||||
array_unshift($config['rules'], "DOMAIN,{$subsDomain},DIRECT");
|
array_unshift($config['rules'], "DOMAIN,{$subsDomain},DIRECT");
|
||||||
}
|
}
|
||||||
// Force the nodes ip to be a direct rule
|
// // Force the nodes ip to be a direct rule
|
||||||
collect($this->servers)->pluck('host')->map(function ($host) {
|
// collect($this->servers)->pluck('host')->map(function ($host) {
|
||||||
$host = trim($host);
|
// $host = trim($host);
|
||||||
return filter_var($host, FILTER_VALIDATE_IP) ? [$host] : Helper::getIpByDomainName($host);
|
// return filter_var($host, FILTER_VALIDATE_IP) ? [$host] : Helper::getIpByDomainName($host);
|
||||||
})->flatten()->unique()->each(function ($nodeIP) use (&$config) {
|
// })->flatten()->unique()->each(function ($nodeIP) use (&$config) {
|
||||||
array_unshift($config['rules'], "IP-CIDR,{$nodeIP}/32,DIRECT,no-resolve");
|
// array_unshift($config['rules'], "IP-CIDR,{$nodeIP}/32,DIRECT,no-resolve");
|
||||||
});
|
// });
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
@ -126,13 +126,13 @@ class ClashMeta implements ProtocolInterface
|
|||||||
if ($subsDomain) {
|
if ($subsDomain) {
|
||||||
array_unshift($config['rules'], "DOMAIN,{$subsDomain},DIRECT");
|
array_unshift($config['rules'], "DOMAIN,{$subsDomain},DIRECT");
|
||||||
}
|
}
|
||||||
// Force the nodes ip to be a direct rule
|
// // Force the nodes ip to be a direct rule
|
||||||
collect($this->servers)->pluck('host')->map(function ($host) {
|
// collect($this->servers)->pluck('host')->map(function ($host) {
|
||||||
$host = trim($host);
|
// $host = trim($host);
|
||||||
return filter_var($host, FILTER_VALIDATE_IP) ? [$host] : Helper::getIpByDomainName($host);
|
// return filter_var($host, FILTER_VALIDATE_IP) ? [$host] : Helper::getIpByDomainName($host);
|
||||||
})->flatten()->unique()->each(function ($nodeIP) use (&$config) {
|
// })->flatten()->unique()->each(function ($nodeIP) use (&$config) {
|
||||||
array_unshift($config['rules'], "IP-CIDR,{$nodeIP}/32,DIRECT,no-resolve");
|
// array_unshift($config['rules'], "IP-CIDR,{$nodeIP}/32,DIRECT,no-resolve");
|
||||||
});
|
// });
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
@ -103,12 +103,12 @@ class SingBox implements ProtocolInterface
|
|||||||
{
|
{
|
||||||
$rules = $this->config['route']['rules'];
|
$rules = $this->config['route']['rules'];
|
||||||
// Force the nodes ip to be a direct rule
|
// Force the nodes ip to be a direct rule
|
||||||
array_unshift($rules, [
|
// array_unshift($rules, [
|
||||||
'ip_cidr' => collect($this->servers)->pluck('host')->map(function ($host) {
|
// 'ip_cidr' => collect($this->servers)->pluck('host')->map(function ($host) {
|
||||||
return filter_var($host, FILTER_VALIDATE_IP) ? [$host] : Helper::getIpByDomainName($host);
|
// return filter_var($host, FILTER_VALIDATE_IP) ? [$host] : Helper::getIpByDomainName($host);
|
||||||
})->flatten()->unique()->values(),
|
// })->flatten()->unique()->values(),
|
||||||
'outbound' => 'direct',
|
// 'outbound' => 'direct',
|
||||||
]);
|
// ]);
|
||||||
$this->config['route']['rules'] = $rules;
|
$this->config['route']['rules'] = $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user