Compare commits

...

4 Commits

Author SHA1 Message Date
ca72206ab4 4.0.10 2021-08-24 11:41:22 +02:00
0221c3207e fix(core): update 2021-08-24 11:41:22 +02:00
f2b8fa57af 4.0.9 2021-08-24 11:40:44 +02:00
e5b072d99b fix(core): update 2021-08-24 11:40:44 +02:00
5 changed files with 14753 additions and 27 deletions

View File

@ -36,6 +36,7 @@ auditProductionDependencies:
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci

14751
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartdns",
"version": "4.0.8",
"version": "4.0.10",
"private": false,
"description": "smart dns methods written in TypeScript",
"main": "dist_ts/index.js",

View File

@ -2,7 +2,7 @@ import * as smartenv from '@pushrocks/smartenv';
const smartenvInstance = new smartenv.Smartenv();
// node native scope
import type dnsType from 'dns';
const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns');
const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns');
export { dns };
@ -21,6 +21,4 @@ export { tsclass };
const dns2 = smartenvInstance.getSafeNodeModule('dns2');
export {
dns2
}
export { dns2 };

View File

@ -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 {