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", "name": "sub-store",
"version": "2.14.51", "version": "2.14.52",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -3,6 +3,9 @@ import { isPresent } from '@/core/proxy-utils/producers/utils';
export default function Clash_Producer() { export default function Clash_Producer() {
const type = 'ALL'; const type = 'ALL';
const produce = (proxies) => { 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 // filter unsupported proxies
proxies = proxies.filter((proxy) => { proxies = proxies.filter((proxy) => {
if ( if (
@ -10,17 +13,17 @@ export default function Clash_Producer() {
'ss', 'ss',
'ssr', 'ssr',
'vmess', 'vmess',
'vless',
'socks', 'socks',
'http', 'http',
'snell', 'snell',
'trojan', 'trojan',
'wireguard', 'wireguard',
].includes(proxy.type) ].includes(proxy.type) ||
) { (proxy.type === 'snell' && String(proxy.version) === '4') ||
return false; (proxy.type === 'vless' &&
} else if ( (typeof proxy.flow !== 'undefined' ||
proxy.type === 'snell' && proxy['reality-opts']))
String(proxy.version) === '4'
) { ) {
return false; return false;
} }