Update server.js via upload script - 2026-08-01 17:19:13

This commit is contained in:
mike 2026-08-01 17:19:34 +08:00
parent 672044b37b
commit 05feb6f523
1 changed files with 12 additions and 5 deletions

View File

@ -213,17 +213,24 @@ function wsHandshakeCheck(line, timeoutMs = 8000) {
}); });
} }
// 返回 { ok, detail } —— detail只在vless-cdn时有意义http/ws两段各自的失败原因 // 返回 { ok, detail }。
// 方便"立即检测"排查究竟是端口/Host/SNI哪一环出的问题而不是只有一个"异常"看不出所以然。 // ⚠️ vless-cdn的"正常/异常"判定口径改成跟SS/VMess/Reality一致——只看TCP连通性。
// 原因httpStatusCheck/wsHandshakeCheck走的是裸TLS握手如果这台VPS本身处在容易被
// SNI关键字探测的网络环境下比如GFW中间设备可能直接往连接里注入垃圾响应
// OpenSSL解析时报EPROTOwrong version number——这是链路层面被幹扰不代表线路真的不可用
// 真实代理客户端Xray等通常有ClientHello分片等反探测手段裸TLS探测测不出真实可用性。
// TCP握手不发SNI不会被这类探测命中所以拿它当判定依据更可靠。HTTP/WS结果继续跑
// 只放进detail做参考不再参与ok的判定。
async function checkLineConnectivity(line) { async function checkLineConnectivity(line) {
if (line.protocol === 'vless-cdn') { if (line.protocol === 'vless-cdn') {
const [httpResult, wsResult] = await Promise.all([ const [tcpOk, httpResult, wsResult] = await Promise.all([
tcpCheck(line.addr, line.port),
httpStatusCheck(line), httpStatusCheck(line),
wsHandshakeCheck(line), wsHandshakeCheck(line),
]); ]);
return { return {
ok: httpResult.ok && wsResult.ok, ok: tcpOk,
detail: `HTTP探测: ${httpResult.detail} | WS握手: ${wsResult.detail}`, detail: `TCP: ${tcpOk ? '连通' : '连接失败'} | HTTP探测: ${httpResult.detail} | WS握手: ${wsResult.detail}`,
}; };
} }
const tcpOk = await tcpCheck(line.addr, line.port); const tcpOk = await tcpCheck(line.addr, line.port);