Compare commits

...

3 Commits

Author SHA1 Message Date
xream
28b233b62c fix: 修复 URI 输出
Some checks failed
build / build (push) Has been cancelled
2025-04-18 15:04:06 +08:00
xream
44d72523ce feat: AnyTLS URI 支持 UDP 参数
Some checks failed
build / build (push) Has been cancelled
2025-04-18 12:24:31 +08:00
xream
b60995f7ac feat: Loon 输入输出正式支持 VLESS XTLS/REALITY, VMess REALITY
Some checks failed
build / build (push) Has been cancelled
2025-04-17 09:57:56 +08:00
4 changed files with 19 additions and 31 deletions

View File

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

View File

@@ -744,6 +744,8 @@ function URI_AnyTLS() {
proxy[key] = value ? value.split(',') : undefined;
} else if (['insecure'].includes(key)) {
proxy['skip-cert-verify'] = /(TRUE)|1/i.test(value);
} else if (['udp'].includes(key)) {
proxy[key] = /(TRUE)|1/i.test(value);
} else {
proxy[key] = value;
}

View File

@@ -151,7 +151,7 @@ function shadowsocks(proxy) {
return result.toString();
}
function shadowsocksr(proxy, includeUnsupportedProxy) {
function shadowsocksr(proxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=shadowsocksr,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`,
@@ -290,17 +290,9 @@ function trojan(proxy) {
return result.toString();
}
function vmess(proxy, includeUnsupportedProxy) {
if (!includeUnsupportedProxy && proxy['reality-opts']) {
throw new Error(`VMess REALITY is not supported`);
}
function vmess(proxy) {
const isReality = !!proxy['reality-opts'];
let isReality = false;
if (includeUnsupportedProxy) {
if (proxy['reality-opts']) {
isReality = true;
}
}
const result = new Result(proxy);
result.append(
`${proxy.name}=vmess,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.uuid}"`,
@@ -397,28 +389,18 @@ function vmess(proxy, includeUnsupportedProxy) {
return result.toString();
}
function vless(proxy, includeUnsupportedProxy) {
if (
!includeUnsupportedProxy &&
(typeof proxy.flow !== 'undefined' || proxy['reality-opts'])
) {
throw new Error(`VLESS XTLS/REALITY is not supported`);
}
function vless(proxy) {
let isXtls = false;
let isReality = false;
if (includeUnsupportedProxy) {
if (proxy['reality-opts']) {
isReality = true;
}
const isReality = !!proxy['reality-opts'];
if (typeof proxy.flow !== 'undefined') {
if (['xtls-rprx-vision'].includes(proxy.flow)) {
isXtls = true;
} else {
throw new Error(`VLESS flow(${proxy.flow}) is not supported`);
}
if (typeof proxy.flow !== 'undefined') {
if (['xtls-rprx-vision'].includes(proxy.flow)) {
isXtls = true;
} else {
throw new Error(`VLESS flow(${proxy.flow}) is not supported`);
}
}
const result = new Result(proxy);
result.append(
`${proxy.name}=vless,${proxy.server},${proxy.port},"${proxy.uuid}"`,

View File

@@ -12,7 +12,7 @@ export default function URI_Producer() {
delete proxy.resolved;
delete proxy['no-resolve'];
for (const key in proxy) {
if (proxy[key] == null || /^_/i.test(key)) {
if (proxy[key] == null) {
delete proxy[key];
}
}
@@ -589,6 +589,10 @@ export default function URI_Producer() {
if (proxy[key]) {
anytlsParams.push(`insecure=1`);
}
} else if (['udp'].includes(key)) {
if (proxy[key]) {
anytlsParams.push(`udp=1`);
}
} else if (proxy[key]) {
anytlsParams.push(
`${i.replace(/-/g, '_')}=${encodeURIComponent(