Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
f2b8fa57af | |||
e5b072d99b |
14751
package-lock.json
generated
14751
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartdns",
|
||||
"version": "4.0.8",
|
||||
"version": "4.0.9",
|
||||
"private": false,
|
||||
"description": "smart dns methods written in TypeScript",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -21,6 +21,4 @@ export { tsclass };
|
||||
|
||||
const dns2 = smartenvInstance.getSafeNodeModule('dns2');
|
||||
|
||||
export {
|
||||
dns2
|
||||
}
|
||||
export { dns2 };
|
||||
|
20
ts/index.ts
20
ts/index.ts
@ -2,6 +2,26 @@ import * as plugins from './dnsly.plugins';
|
||||
|
||||
export type TDnsProvider = 'google' | 'cloudflare';
|
||||
|
||||
export const makeNodeProcessUseDnsProvider = async (providerArg: TDnsProvider) => {
|
||||
switch (providerArg) {
|
||||
case 'cloudflare':
|
||||
plugins.dns.setServers([
|
||||
'1.1.1.1',
|
||||
'1.0.0.1',
|
||||
'[2606:4700:4700::1111]',
|
||||
'[2606:4700:4700::1001]',
|
||||
]);
|
||||
break;
|
||||
case 'google':
|
||||
plugins.dns.setServers([
|
||||
'8.8.8.8',
|
||||
'8.8.4.4',
|
||||
'[2001:4860:4860::8888]',
|
||||
'[2606:4700:4700::1001]',
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
export interface ISmartDnsConstructorOptions {}
|
||||
|
||||
export interface IGoogleDNSHTTPSResponse {
|
||||
|
Reference in New Issue
Block a user