feat: 支持 Clash VLESS 输出(与 Clash.Meta 的区别为: 无 XTLS

This commit is contained in:
xream 2023-09-11 02:34:37 +08:00
parent 939022e5a3
commit 2c89a0ddbd
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 10 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.51",
"version": "2.14.52",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@ -3,6 +3,9 @@ import { isPresent } from '@/core/proxy-utils/producers/utils';
export default function Clash_Producer() {
const type = 'ALL';
const produce = (proxies) => {
// VLESS XTLS is not supported by Clash
// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml#L532
// github.com/Dreamacro/clash/pull/2891/files
// filter unsupported proxies
proxies = proxies.filter((proxy) => {
if (
@ -10,17 +13,17 @@ export default function Clash_Producer() {
'ss',
'ssr',
'vmess',
'vless',
'socks',
'http',
'snell',
'trojan',
'wireguard',
].includes(proxy.type)
) {
return false;
} else if (
proxy.type === 'snell' &&
String(proxy.version) === '4'
].includes(proxy.type) ||
(proxy.type === 'snell' && String(proxy.version) === '4') ||
(proxy.type === 'vless' &&
(typeof proxy.flow !== 'undefined' ||
proxy['reality-opts']))
) {
return false;
}