support new clash config

This commit is contained in:
Tokumeikoi 2020-07-05 13:18:43 +08:00
parent 001f0ced41
commit 4f8ba2b59d
2 changed files with 6 additions and 6 deletions

View File

@ -209,9 +209,9 @@ class ClientController extends Controller
array_push($proxies, $item->name);
}
$config['Proxy'] = array_merge($config['Proxy'] ? $config['Proxy'] : [], $proxy);
foreach ($config['Proxy Group'] as $k => $v) {
$config['Proxy Group'][$k]['proxies'] = array_merge($config['Proxy Group'][$k]['proxies'], $proxies);
$config['proxies'] = array_merge($config['proxies'] ? $config['proxies'] : [], $proxy);
foreach ($config['proxy-groups'] as $k => $v) {
$config['proxy-groups'][$k]['proxies'] = array_merge($config['proxy-groups'][$k]['proxies'], $proxies);
}
$yaml = Yaml::dump($config);
$yaml = str_replace('$app_name', config('v2board.app_name', 'V2Board'), $yaml);

View File

@ -16,14 +16,14 @@ dns:
fallback:
- tls://1.0.0.1:853
- tls://dns.google:853
Proxy:
proxies:
Proxy Group:
proxy-groups:
- { name: "$app_name", type: select, proxies: ["自动选择", "故障转移"] }
- { name: "自动选择", type: url-test, proxies: [], url: "http://www.gstatic.com/generate_204", interval: 86400 }
- { name: "故障转移", type: fallback, proxies: [], url: "http://www.gstatic.com/generate_204", interval: 7200 }
Rule:
rules:
# Apple
- DOMAIN,safebrowsing.urlsec.qq.com,DIRECT # 如果您并不信任此服务提供商或防止其下载消耗过多带宽资源,可以进入 Safari 设置,关闭 Fraudulent Website Warning 功能,并使用 REJECT 策略。
- DOMAIN,safebrowsing.googleapis.com,DIRECT # 如果您并不信任此服务提供商或防止其下载消耗过多带宽资源,可以进入 Safari 设置,关闭 Fraudulent Website Warning 功能,并使用 REJECT 策略。