Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

num-client

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

num-client - npm Package Compare versions

Comparing version 1.0.26 to 1.0.27

3

dist/dnsclient.d.ts

@@ -5,3 +5,6 @@ import { AxiosProxy } from './axiosproxy';

readonly url: string;
activeFrom: number;
constructor(name: string, url: string);
isActive(): boolean;
disableForSeconds(n: number): void;
}

@@ -8,0 +11,0 @@ export declare class Question {

@@ -52,3 +52,10 @@ "use strict";

this.url = url;
this.activeFrom = Date.now();
}
DoHResolver.prototype.isActive = function () {
return this.activeFrom <= Date.now();
};
DoHResolver.prototype.disableForSeconds = function (n) {
this.activeFrom = Date.now() + 1000 * n;
};
return DoHResolver;

@@ -55,0 +62,0 @@ }());

@@ -136,2 +136,3 @@ "use strict";

question = new dnsclient_1.Question(query, 'TXT', checkDnsSecValidity);
dohIndex = this.findActiveResolver(dohIndex);
loglevel_1.default.debug("Using DoH: " + this.dnsClients[dohIndex].getResolver().name);

@@ -151,3 +152,5 @@ return [2, this.dnsClients[dohIndex]

}
dohIndex = (dohIndex + 1) % _this.dnsClients.length;
loglevel_1.default.info("The current resolver failed so disable it for a while: " + _this.dnsClients[dohIndex].getResolver().name);
_this.dnsClients[dohIndex].getResolver().disableForSeconds(5);
dohIndex = _this.findActiveResolver(dohIndex);
loglevel_1.default.warn("Switching to DoH: " + _this.dnsClients[dohIndex].getResolver().name + " due to " + JSON.stringify(e));

@@ -159,4 +162,18 @@ return _this._getRecordFromDns(query, checkDnsSecValidity, attempts - 1, dohIndex);

};
DnsServicesImpl.prototype.findActiveResolver = function (dohIndex) {
for (var i = 0; i < this.dnsClients.length; i++) {
dohIndex = (dohIndex + 1) % this.dnsClients.length;
if (this.dnsClients[dohIndex].getResolver().isActive()) {
loglevel_1.default.info("Found an active resolver: " + this.dnsClients[dohIndex].getResolver().name);
break;
}
}
if (!this.dnsClients[dohIndex].getResolver().isActive()) {
loglevel_1.default.info("Can't find an active resolver so re-using this one: " + this.dnsClients[dohIndex].getResolver().name);
this.dnsClients[dohIndex].getResolver().activeFrom = Date.now();
}
return dohIndex;
};
return DnsServicesImpl;
}());
//# sourceMappingURL=dnsservices.js.map

2

package.json
{
"name": "num-client",
"version": "1.0.26",
"version": "1.0.27",
"description": "A NUM Protocol Client in TypeScript",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc