小调整。
parent
23c8b0c5ae
commit
05b45e1bd6
|
@ -69,7 +69,7 @@ function connect (req, cltSocket, head, hostname, port, dnsConfig/* , sniRegexpM
|
||||||
if (tester) {
|
if (tester) {
|
||||||
const aliveIpObj = tester.pickFastAliveIpObj()
|
const aliveIpObj = tester.pickFastAliveIpObj()
|
||||||
if (aliveIpObj) {
|
if (aliveIpObj) {
|
||||||
log.info(`----- connect: ${hostname}:${port}, use alive ip from dns '${aliveIpObj.dns}': ${aliveIpObj.host} -----`)
|
log.info(`----- connect: ${hostport}, use alive ip from dns '${aliveIpObj.dns}': ${aliveIpObj.host} -----`)
|
||||||
callback(null, aliveIpObj.host, 4)
|
callback(null, aliveIpObj.host, 4)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -77,10 +77,10 @@ function connect (req, cltSocket, head, hostname, port, dnsConfig/* , sniRegexpM
|
||||||
dns.lookup(hostname).then(ip => {
|
dns.lookup(hostname).then(ip => {
|
||||||
isDnsIntercept = { dns, hostname, ip }
|
isDnsIntercept = { dns, hostname, ip }
|
||||||
if (ip !== hostname) {
|
if (ip !== hostname) {
|
||||||
log.info(`---- connect: ${hostname}:${port}, use ip from dns '${dns.name}': ${ip} ----`)
|
log.info(`---- connect: ${hostport}, use ip from dns '${dns.name}': ${ip} ----`)
|
||||||
callback(null, ip, 4)
|
callback(null, ip, 4)
|
||||||
} else {
|
} else {
|
||||||
log.info(`----- connect: ${hostname}:${port}, use hostname: ${hostname} -----`)
|
log.info(`----- connect: ${hostport}, use hostname: ${hostname} -----`)
|
||||||
defaultDns.lookup(hostname, options, callback)
|
defaultDns.lookup(hostname, options, callback)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue