wyx2685 / v2board

🚀A multiple proxy protocol manage panel application interface
MIT License
685 stars 206 forks source link

[BUG] Clash-Verge加载订阅链接后得到的配置proxies为空 #6

Closed Riverboat8865 closed 1 year ago

Riverboat8865 commented 1 year ago

🙇‍♂️🙇‍♂️🙇‍♂️注意:XrayR等非V2Board问题请前往项目方提问 🙇‍♂️🙇‍♂️🙇‍♂️Note: XrayR and other non-V2Board issues please go to the project side to ask questions

The V2Board version number you are using 当前使用的V2Board版本号

1.7.4

Briefly describe the problem you are experiencing 简单描述你遇到的问题

使用最新的claash-verge v1.3.6 (meta内核),从网站的订阅连接读取配置,得到proxies的array为空:proxies: [] 。貌似只读取到了模板而已。 是不是php 记录proxy的array没有写到yaml里面啊。换到clash内核也一样哦。

那个ClashMeta.php文件里面的循环: foreach ($config['proxy-groups'] as $k => $v),似乎没用啊,$config['proxy-groups'] 还是空的。 `

    $proxy = [];
    $proxies = [];

    foreach ($servers as $item) {
        if ($item['type'] === 'shadowsocks') {
            array_push($proxy, self::buildShadowsocks($user['uuid'], $item));
            array_push($proxies, $item['name']);
        }
        if ($item['type'] === 'vmess') {
            array_push($proxy, self::buildVmess($user['uuid'], $item));
            array_push($proxies, $item['name']);
        }
        if ($item['type'] === 'vless') {
            array_push($proxy, self::buildVless($user['uuid'], $item));
            array_push($proxies, $item['name']);
        }
        if ($item['type'] === 'trojan') {
            array_push($proxy, self::buildTrojan($user['uuid'], $item));
            array_push($proxies, $item['name']);
        }
    }

    $config['proxies'] = array_merge($config['proxies'] ? $config['proxies'] : [], $proxy);
    foreach ($config['proxy-groups'] as $k => $v) {
        if (!is_array($config['proxy-groups'][$k]['proxies'])) $config['proxy-groups'][$k]['proxies'] = [];
        $isFilter = false;
        foreach ($config['proxy-groups'][$k]['proxies'] as $src) {
            foreach ($proxies as $dst) {
                if (!$this->isRegex($src)) continue;
                $isFilter = true;
                $config['proxy-groups'][$k]['proxies'] = array_values(array_diff($config['proxy-groups'][$k]['proxies'], [$src]));
                if ($this->isMatch($src, $dst)) {
                    array_push($config['proxy-groups'][$k]['proxies'], $dst);
                }
            }
            if ($isFilter) continue;
        }
        if ($isFilter) continue;
        $config['proxy-groups'][$k]['proxies'] = array_merge($config['proxy-groups'][$k]['proxies'], $proxies);
    }

`

Screenshot of the reported error(Please do desensitization) 报告错误的截图(请做脱敏处理)

Screenshot of the reported error(Please do desensitization) 报告错误的截图(请做脱敏处理)

The latest log files in the storage/logs directory report from #1 (Please do desensitization) storage/logs 目录下最新的日志文件从 #1 开始报告(请做脱敏处理)

wyx2685 commented 1 year ago

因为目前只区分了clash和clashmeta verge会判定为clash不获取vless节点,你可以在订阅链接后面手动增加&flag=clashmeta,或者把useragent改成clashmeta

Riverboat8865 commented 1 year ago

Verge可以。所以目前clash for windows不能用吗。订阅加了&flag=clashmeta,还是不行,显示unsupported proxy type: vless。

wyx2685 commented 1 year ago

内核不支持vless呀,这是clash问题