You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dev-sidecar/packages/mitmproxy/test/dnsSpeedTest.js

39 lines
948 B

4 years ago
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: {
4 years ago
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: { //不可用
4 years ago
// type: 'https',
// server: 'https://8.8.8.8/dns-query',
// cacheSize: 1000
// },
// dnsSB: { //不可用
4 years ago
// type: 'https',
// server: 'https://doh.dns.sb/dns-query',
// cacheSize: 1000
// }
})
SpeedTest.initSpeedTest({ hostnameList: {}, dnsMap })
4 years ago
const tester = new SpeedTester({ hostname: 'github.com' })
tester.test().then(ret => {
console.log(tester.alive)
})