From 37b229c301f5d1a1f2a8984d3d04d75d75d46338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=92=80=E7=92=A8=E6=A2=A6=E6=98=9F?= <157385609+cuicanmengxing@users.noreply.github.com> Date: Sun, 12 May 2024 12:24:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D=E5=92=8Chu?= =?UTF-8?q?b.docker.com=E7=9A=84IP=E9=A2=84=E8=AE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mitmproxy/src/lib/dns/https.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/mitmproxy/src/lib/dns/https.js b/packages/mitmproxy/src/lib/dns/https.js index 4aca763..b7a1f28 100644 --- a/packages/mitmproxy/src/lib/dns/https.js +++ b/packages/mitmproxy/src/lib/dns/https.js @@ -19,11 +19,16 @@ module.exports = class DNSOverHTTPS extends BaseDNS { // 20.27.177.113日本(三网平均延时88MS(三网优秀)) 20.205.243.166新加坡(三网平均延时96MS(电信联通106.5平均延时,移动平均77MS)) 20.200.245.247韩国(三网平均108ms(移动平均120ms)) } // 直接判断域名是否为example.com - if (hostname === 'github.com') { - log.info('域名github.com使用内置IP集') + if (hostname === 'api.github.com') { + log.info('域名api.github.com使用内置IP集') // 返回预设的IP地址集 return ['20.27.177.116', '20.205.243.168', '20.200.245.245'] } + if (hostname === 'hub.docker.com') { + log.info('域名hub.docker.com使用内置IP集') + // 返回预设的IP地址集 + return ['54.156.140.159', '52.44.227.212', '44.221.37.199'] + } try { const result = await dohQueryAsync({ url: this.dnsServer }, [{ type: 'A', name: hostname }]) if (result.answers.length === 0) {