Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
ca72206ab4 | |||
0221c3207e | |||
f2b8fa57af | |||
e5b072d99b |
@ -36,6 +36,7 @@ auditProductionDependencies:
|
|||||||
- npmci command npm audit --audit-level=high --only=prod --production
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
auditDevDependencies:
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
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",
|
"name": "@pushrocks/smartdns",
|
||||||
"version": "4.0.8",
|
"version": "4.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "smart dns methods written in TypeScript",
|
"description": "smart dns methods written in TypeScript",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -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 {
|
||||||
|
Reference in New Issue
Block a user