From 63887e3dad79bd50c0c1c17da66e3a9178c6297a Mon Sep 17 00:00:00 2001 From: xream Date: Wed, 17 Jan 2024 19:30:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E8=A7=A3=E6=9E=90=20?= =?UTF-8?q?QX=20VLESS=20=E8=BE=93=E5=85=A5;=20VLESS=20=E6=97=A0=20network?= =?UTF-8?q?=20=E6=97=B6,=20=E9=BB=98=E8=AE=A4=E4=B8=BA=20tcp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- backend/package.json | 2 +- backend/src/core/proxy-utils/index.js | 5 +++++ backend/src/core/proxy-utils/parsers/index.js | 10 ++++++++++ backend/src/core/proxy-utils/parsers/peggy/qx.js | 9 ++++++++- backend/src/core/proxy-utils/parsers/peggy/qx.peg | 9 ++++++++- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fb39789..4b8c1d0 100644 --- a/README.md +++ b/README.md @@ -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)) diff --git a/backend/package.json b/backend/package.json index cb53c5d..5cfa86f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -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": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index e20c9bb..0ec8297 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -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; } diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index d0b0cf3..26bb0f3 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -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(), diff --git a/backend/src/core/proxy-utils/parsers/peggy/qx.js b/backend/src/core/proxy-utils/parsers/peggy/qx.js index 9fefcb4..98a1c98 100644 --- a/backend/src/core/proxy-utils/parsers/peggy/qx.js +++ b/backend/src/core/proxy-utils/parsers/peggy/qx.js @@ -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"; diff --git a/backend/src/core/proxy-utils/parsers/peggy/qx.peg b/backend/src/core/proxy-utils/parsers/peggy/qx.peg index f2ae8ce..bf2a7f6 100644 --- a/backend/src/core/proxy-utils/parsers/peggy/qx.peg +++ b/backend/src/core/proxy-utils/parsers/peggy/qx.peg @@ -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";