diff --git a/config/appprofile.php b/config/appprofile.php index ec2b30c3..dea26d4f 100755 --- a/config/appprofile.php +++ b/config/appprofile.php @@ -163,7 +163,7 @@ $_ENV['SingBox_Config'] = [ ], ]; -$_ENV['Clash_Config'] = [ +$_ENV['Clash_Config_back'] = [ 'port' => 7890, 'socks-port' => 7891, 'allow-lan' => false, @@ -197,6 +197,43 @@ $_ENV['Clash_Config'] = [ ], ]; +$_ENV['Clash_Config'] = [ + 'mixed-port' => 7890, + 'allow-lan' => true, + 'bind-address' => '*', + 'mode' => 'Rule', + 'log-level' => 'error', + 'external-controller' => '127.0.0.1:9090', + 'dns' => [ + 'enable' => true, + 'ipv6' => false, + 'default-nameserver' => [ + '223.5.5.5', + '119.29.29.29', + ], + 'enhanced-mode' => 'fake-ip', + 'fake-ip-range' => '198.18.0.1/16', + 'use-hosts' => true, + 'nameserver' => [ + 'https://doh.pub/dns-query', + 'https://dns.alidns.com/dns-query', + ], + 'fallback' => [ + 'https://doh.dns.sb/dns-query', + 'https://dns.cloudflare.com/dns-query', + 'https://dns.twnic.tw/dns-query', + 'tls://8.8.4.4:853', + ], + 'fallback-filter' => [ + 'geoip' => true, + 'ipcidr' => [ + '240.0.0.0/4', + '0.0.0.0/32', + ], + ], + ], +]; + // Clash group indexes to be inserted node names $_ENV['Clash_Group_Indexes'] = [0, 1, 2, 4]; diff --git a/src/Services/Subscribe/Clash.php b/src/Services/Subscribe/Clash.php index 430a01bf..c3e4aa12 100755 --- a/src/Services/Subscribe/Clash.php +++ b/src/Services/Subscribe/Clash.php @@ -28,6 +28,7 @@ final class Clash extends Base case 0: $plugin = $node_custom_config['plugin'] ?? ''; $plugin_option = $node_custom_config['plugin_option'] ?? null; + $method = $node_custom_config['method'] ?? 'aes-128-gcm'; // Clash 特定配置 $udp = $node_custom_config['udp'] ?? true; @@ -37,10 +38,10 @@ final class Clash extends Base 'server' => $node_raw->server, 'port' => (int) $node_custom_config['offset_port_user'], 'password' => $user->passwd, - 'cipher' => $node_custom_config['method'], + 'cipher' => $method, 'udp' => (bool) $udp, - 'plugin' => $plugin, - 'plugin-opts' => $plugin_option, +// 'plugin' => $plugin, +// 'plugin-opts' => $plugin_option, ]; break;