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