代理连接超时,也记录失败次数。

pull/333/head
王良 2024-08-20 15:53:18 +08:00
parent 2b8acc2507
commit f8b094244a
1 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,12 @@ function connect (req, cltSocket, head, hostname, port, dnsConfig/* , sniRegexpM
log.error(errorMsg) log.error(errorMsg)
cltSocket.destroy() cltSocket.destroy()
if (isDnsIntercept && isDnsIntercept.dns && isDnsIntercept.ip !== isDnsIntercept.hostname) {
const { dns, ip, hostname } = isDnsIntercept
dns.count(hostname, ip, true)
log.error(`记录ip失败次数用于优选ip hostname: ${hostname}, ip: ${ip}, reason: ${errorMsg}, dns: ${dns.name}`)
}
}) })
proxySocket.on('error', (e) => { proxySocket.on('error', (e) => {
// 连接失败可能被GFW拦截或者服务端拥挤 // 连接失败可能被GFW拦截或者服务端拥挤