fix(core): update
This commit is contained in:
parent
97c57b2865
commit
e5b072d99b
14749
package-lock.json
generated
14749
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -55,4 +55,4 @@
|
|||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 1 chrome versions"
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -2,7 +2,7 @@ import * as smartenv from '@pushrocks/smartenv';
|
|||||||
const smartenvInstance = new smartenv.Smartenv();
|
const smartenvInstance = new smartenv.Smartenv();
|
||||||
// node native scope
|
// node native scope
|
||||||
import type dnsType from 'dns';
|
import type dnsType from 'dns';
|
||||||
const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns');
|
const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns');
|
||||||
|
|
||||||
export { dns };
|
export { dns };
|
||||||
|
|
||||||
@ -21,6 +21,4 @@ export { tsclass };
|
|||||||
|
|
||||||
const dns2 = smartenvInstance.getSafeNodeModule('dns2');
|
const dns2 = smartenvInstance.getSafeNodeModule('dns2');
|
||||||
|
|
||||||
export {
|
export { dns2 };
|
||||||
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 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 ISmartDnsConstructorOptions {}
|
||||||
|
|
||||||
export interface IGoogleDNSHTTPSResponse {
|
export interface IGoogleDNSHTTPSResponse {
|
||||||
|
Loading…
Reference in New Issue
Block a user