feat: 新增 anytls/tuic/hysteria2/socks5 协议解析
新增 anytls、tuic(tuic-v5)、hysteria2、socks5/socks5-tls 解析器, 修复 vmess WebSocket path 处理,并优化 Docker 构建配置。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,10 @@ import { parseSS, type ParsedNode } from './ss.js';
|
||||
import { parseVMess } from './vmess.js';
|
||||
import { parseTrojan } from './trojan.js';
|
||||
import { parseVless } from './vless.js';
|
||||
import { parseSocks5, parseSocks5Tls } from './socks.js';
|
||||
import { parseHysteria2 } from './hysteria2.js';
|
||||
import { parseTuic } from './tuic.js';
|
||||
import { parseAnytls } from './anytls.js';
|
||||
|
||||
export type { ParsedNode };
|
||||
|
||||
@@ -11,6 +15,13 @@ export function parseNodeUri(uri: string): ParsedNode | null {
|
||||
if (uri.startsWith('vmess://')) return parseVMess(uri);
|
||||
if (uri.startsWith('trojan://')) return parseTrojan(uri);
|
||||
if (uri.startsWith('vless://')) return parseVless(uri);
|
||||
if (uri.startsWith('hysteria2://') || uri.startsWith('hy2://')) return parseHysteria2(uri);
|
||||
if (uri.startsWith('tuic://')) return parseTuic(uri);
|
||||
if (uri.startsWith('anytls://')) return parseAnytls(uri);
|
||||
// socks5-over-tls variants must be checked before plain socks
|
||||
if (uri.startsWith('socks5-tls://') || uri.startsWith('socks5+tls://') || uri.startsWith('socks+tls://'))
|
||||
return parseSocks5Tls(uri);
|
||||
if (uri.startsWith('socks5://') || uri.startsWith('socks://')) return parseSocks5(uri);
|
||||
return null;
|
||||
} catch {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user