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