feat: 支持解析 QX VLESS 输入; VLESS 无 network 时, 默认为 tcp

This commit is contained in:
xream 2024-01-17 19:30:23 +08:00
parent 7fd585b5d4
commit 63887e3dad
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
6 changed files with 33 additions and 4 deletions

View File

@ -31,7 +31,7 @@ Core functionalities:
- [x] SSD URI
- [x] V2RayN URI
- [x] Hysteria2 URI
- [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5)
- [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5, VLESS)
- [x] Loon (SS, SSR, VMess, Trojan, HTTP, SOCKS5, WireGuard, VLESS, Hysteria2)
- [x] Surge (SS, VMess, Trojan, HTTP, SOCKS5, TUIC, Snell, Hysteria2, SSR(external, only for macOS), WireGuard(Surge to Surge))
- [x] Surfboard (SS, VMess, Trojan, HTTP, SOCKS5, WireGuard(Surfboard to Surfboard))

View File

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

View File

@ -229,6 +229,11 @@ function lastParse(proxy) {
delete proxy.network;
}
}
if (['vless'].includes(proxy.type)) {
if (!proxy.network) {
proxy.network = 'tcp';
}
}
if (['trojan', 'tuic', 'hysteria', 'hysteria2'].includes(proxy.type)) {
proxy.tls = true;
}

View File

@ -621,6 +621,15 @@ function QX_VMess() {
return { name, test, parse };
}
function QX_VLESS() {
const name = 'QX VLESS Parser';
const test = (line) => {
return /^vless\s*=/.test(line.split(',')[0].trim());
};
const parse = (line) => getQXParser().parse(line);
return { name, test, parse };
}
function QX_Trojan() {
const name = 'QX Trojan Parser';
const test = (line) => {
@ -1017,6 +1026,7 @@ export default [
QX_SS(),
QX_SSR(),
QX_VMess(),
QX_VLESS(),
QX_Trojan(),
QX_Http(),
QX_Socks5(),

View File

@ -38,7 +38,7 @@ const grammars = String.raw`
}
}
start = (trojan/shadowsocks/vmess/http/socks5) {
start = (trojan/shadowsocks/vmess/vless/http/socks5) {
return proxy
}
@ -91,6 +91,13 @@ vmess = "vmess" equals address
handleObfs();
}
vless = "vless" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vless";
proxy.cipher = proxy.cipher || "none";
handleObfs();
}
http = "http" equals address
(username/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)*{
proxy.type = "http";

View File

@ -36,7 +36,7 @@
}
}
start = (trojan/shadowsocks/vmess/http/socks5) {
start = (trojan/shadowsocks/vmess/vless/http/socks5) {
return proxy
}
@ -89,6 +89,13 @@ vmess = "vmess" equals address
handleObfs();
}
vless = "vless" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vless";
proxy.cipher = proxy.cipher || "none";
handleObfs();
}
http = "http" equals address
(username/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)*{
proxy.type = "http";