You've already forked dev-sidecar
mirror of
https://github.com/docmirror/dev-sidecar.git
synced 2025-11-26 14:10:40 +08:00
optimize: usa重命名为cloudflare后,向下兼容原来的usa配置。
This commit is contained in:
38
packages/mitmproxy/test/dnsSpeedTest.js
Normal file
38
packages/mitmproxy/test/dnsSpeedTest.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const SpeedTester = require('../src/lib/speed/SpeedTester.js')
|
||||
const SpeedTest = require('../src/lib/speed/index.js')
|
||||
const dns = require('../src/lib/dns/index.js')
|
||||
|
||||
const dnsMap = dns.initDNS({
|
||||
// ipaddress: {
|
||||
// type: 'ipaddress',
|
||||
// server: 'ipaddress',
|
||||
// cacheSize: 1000
|
||||
// },
|
||||
cloudflare: {
|
||||
type: 'https',
|
||||
server: 'https://1.1.1.1/dns-query',
|
||||
cacheSize: 1000
|
||||
}
|
||||
// py233: { //污染
|
||||
// type: 'https',
|
||||
// server: ' https://i.233py.com/dns-query',
|
||||
// cacheSize: 1000
|
||||
// }
|
||||
// google: { //不可用
|
||||
// type: 'https',
|
||||
// server: 'https://8.8.8.8/dns-query',
|
||||
// cacheSize: 1000
|
||||
// },
|
||||
// dnsSB: { //不可用
|
||||
// type: 'https',
|
||||
// server: 'https://doh.dns.sb/dns-query',
|
||||
// cacheSize: 1000
|
||||
// }
|
||||
})
|
||||
|
||||
SpeedTest.initSpeedTest({ hostnameList: {}, dnsMap })
|
||||
|
||||
const tester = new SpeedTester({ hostname: 'github.com' })
|
||||
tester.test().then(ret => {
|
||||
console.log(tester.alive)
|
||||
})
|
||||
Reference in New Issue
Block a user