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

This commit is contained in:
xream
2024-01-17 19:30:23 +08:00
parent 7fd585b5d4
commit 63887e3dad
6 changed files with 33 additions and 4 deletions

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";