2021-03-24 05:59:19 +00:00
|
|
|
const dns = require('../src/lib/dns/index.js')
|
2024-11-15 04:09:33 +00:00
|
|
|
const SpeedTest = require('../src/lib/speed/index.js')
|
|
|
|
const SpeedTester = require('../src/lib/speed/SpeedTester.js')
|
2021-03-24 05:59:19 +00:00
|
|
|
|
|
|
|
const dnsMap = dns.initDNS({
|
2021-03-24 06:18:27 +00:00
|
|
|
// ipaddress: {
|
|
|
|
// type: 'ipaddress',
|
|
|
|
// server: 'ipaddress',
|
|
|
|
// cacheSize: 1000
|
|
|
|
// },
|
2024-07-08 08:48:15 +00:00
|
|
|
cloudflare: {
|
2021-03-24 05:59:19 +00:00
|
|
|
type: 'https',
|
|
|
|
server: 'https://1.1.1.1/dns-query',
|
2024-11-15 04:09:33 +00:00
|
|
|
cacheSize: 1000,
|
|
|
|
},
|
2021-03-24 06:18:27 +00:00
|
|
|
// py233: { //污染
|
|
|
|
// type: 'https',
|
|
|
|
// server: ' https://i.233py.com/dns-query',
|
|
|
|
// cacheSize: 1000
|
|
|
|
// }
|
|
|
|
// google: { //不可用
|
2021-03-24 05:59:19 +00:00
|
|
|
// type: 'https',
|
|
|
|
// server: 'https://8.8.8.8/dns-query',
|
|
|
|
// cacheSize: 1000
|
|
|
|
// },
|
2021-03-24 06:18:27 +00:00
|
|
|
// dnsSB: { //不可用
|
2021-03-24 05:59:19 +00:00
|
|
|
// type: 'https',
|
|
|
|
// server: 'https://doh.dns.sb/dns-query',
|
|
|
|
// cacheSize: 1000
|
|
|
|
// }
|
|
|
|
})
|
|
|
|
|
2021-03-25 15:40:54 +00:00
|
|
|
SpeedTest.initSpeedTest({ hostnameList: {}, dnsMap })
|
2021-03-24 05:59:19 +00:00
|
|
|
|
|
|
|
const tester = new SpeedTester({ hostname: 'github.com' })
|
2025-02-08 08:25:13 +00:00
|
|
|
tester.test().then(() => {
|
|
|
|
console.log('github.com tester.alive = ', tester.alive)
|
2021-03-24 05:59:19 +00:00
|
|
|
})
|