|
@@ -75,29 +75,31 @@ class SingBox
|
|
|
];
|
|
|
|
|
|
// 先创建 "proxy" 组并添加到配置的最前面
|
|
|
- $proxyOutbound = $this->buildOutbound("proxy", "selector", "hk", []);
|
|
|
+ $proxyOutbound = $this->buildOutbound("proxy", "selector", "", []);
|
|
|
array_unshift($config['outbounds'], $proxyOutbound);
|
|
|
|
|
|
// 创建每个地区的代理组
|
|
|
- foreach ($regions as $regionTag => $pattern) {
|
|
|
- $tags = $this->buildTags($proxies, $pattern);
|
|
|
- $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound($regionTag, "selector", "", $tags));
|
|
|
- $usedTags = array_merge($usedTags, $tags);
|
|
|
- $regionTags[] = $regionTag;
|
|
|
- }
|
|
|
+// foreach ($regions as $regionTag => $pattern) {
|
|
|
+// $tags = $this->buildTags($proxies, $pattern);
|
|
|
+// $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound($regionTag, "selector", "", $tags));
|
|
|
+// $usedTags = array_merge($usedTags, $tags);
|
|
|
+// $regionTags[] = $regionTag;
|
|
|
+// }
|
|
|
|
|
|
// 创建 "其他" 代理组
|
|
|
- $allTags = array_column($proxies, 'tag');
|
|
|
- $otherTags = array_diff($allTags, $usedTags);
|
|
|
- $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound("other", "selector", "", $otherTags));
|
|
|
- $regionTags[] = "other";
|
|
|
- $this->updateOrAddOutbound($config['outbounds'],$this->buildOutbound("dns", "selector", "", $this->buildTags($proxies,"")));
|
|
|
+// $allTags = array_column($proxies, 'tag');
|
|
|
+// $otherTags = array_diff($allTags, $usedTags);
|
|
|
+// $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound("other", "selector", "", $otherTags));
|
|
|
+// $regionTags[] = "other";
|
|
|
+// $this->updateOrAddOutbound($config['outbounds'],$this->buildOutbound("dns", "selector", "", $this->buildTags($proxies,"")));
|
|
|
|
|
|
// $this->updateOrAddOutbound($config['outbounds'],$this->buildOutbound("用户中心", "selector", "", [$uri]));
|
|
|
$this->updateOrAddOutbound($config['outbounds'], $userConfig);
|
|
|
-
|
|
|
+ foreach ($proxies as $proxy){
|
|
|
+ $regionTags[] = $proxy["tag"];
|
|
|
+ }
|
|
|
$usedCus = array_merge($regionTags, [$uri]);
|
|
|
- // 更新 "proxy" 组,包含所有地区和其他代理组的 tag
|
|
|
+// // 更新 "proxy" 组,包含所有地区和其他代理组的 tag
|
|
|
$config['outbounds'][0]['outbounds'] = $usedCus;
|
|
|
//$config['outbounds'][0]['outbounds'] = ;
|
|
|
// 将所有 $proxies 加入到 $config['outbounds']
|