New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ip2proxy-nodejs

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip2proxy-nodejs - npm Package Compare versions

Comparing version
4.3.1
to
4.3.2
+1
-1
package.json
{
"name": "ip2proxy-nodejs",
"version": "4.3.1",
"version": "4.3.2",
"description": "IP2Proxy proxy detection component",

@@ -5,0 +5,0 @@ "keywords": [

@@ -7,3 +7,3 @@ const net = require("net");

// For BIN queries
const VERSION = "4.3.1";
const VERSION = "4.3.2";
const MAX_INDEX = 65536;

@@ -29,2 +29,4 @@ const COUNTRY_POSITION = [0, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3];

const LAST_32_BITS = BigInt("4294967295");
const FROM_IPV4_MAPPED_IPV6 = BigInt("281470681743360");
const TO_IPV4_MAPPED_IPV6 = BigInt("281474976710655");
const MODES = {

@@ -132,2 +134,3 @@ COUNTRY_SHORT: 1,

#fd;
#fh;

@@ -402,4 +405,4 @@ constructor() {}

if (this.#binFile && this.#binFile != "") {
let fh = await fsp.open(this.#binFile, "r");
this.#fd = fh.fd;
this.#fh = await fsp.open(this.#binFile, "r");
this.#fd = this.#fh.fd;

@@ -556,3 +559,3 @@ let len = 64; // 64-byte header

// Reset everything (do not use in async case due to race conditions)
// Reset everything
close() {

@@ -576,3 +579,3 @@ try {

this.#myDB.fileSize = 0;
fs.closeSync(this.#fd);
fs.closeSync(this.#fd); // normal file handle
return 0;

@@ -584,2 +587,28 @@ } catch (err) {

// Reset everything
async closeAsync() {
try {
this.#myDB.baseAddress = 0;
this.#myDB.dbCount = 0;
this.#myDB.dbColumn = 0;
this.#myDB.dbType = 0;
this.#myDB.dbDay = 0;
this.#myDB.dbMonth = 0;
this.#myDB.dbYear = 0;
this.#myDB.baseAddressIPV6 = 0;
this.#myDB.dbCountIPV6 = 0;
this.#myDB.indexed = 0;
this.#myDB.indexedIPV6 = 0;
this.#myDB.indexBaseAddress = 0;
this.#myDB.indexBaseAddressIPV6 = 0;
this.#myDB.productCode = 0;
this.#myDB.productType = 0;
this.#myDB.fileSize = 0;
await this.#fh.close(); // FileHandler object opened by fs.Promises
return 0;
} catch (err) {
return -1;
}
}
// Search BIN for the data

@@ -625,3 +654,4 @@ proxyQueryData(myIP, ipType, data, mode) {

(ipNumber >= FROM_6TO4 && ipNumber <= TO_6TO4) ||
(ipNumber >= FROM_TEREDO && ipNumber <= TO_TEREDO)
(ipNumber >= FROM_TEREDO && ipNumber <= TO_TEREDO) ||
(ipNumber >= FROM_IPV4_MAPPED_IPV6 && ipNumber <= TO_IPV4_MAPPED_IPV6)
) {

@@ -636,4 +666,6 @@ ipType = 4;

ipNumber = Number((ipNumber >> BigInt(80)) & LAST_32_BITS);
} else if (ipNumber >= FROM_TEREDO && ipNumber <= TO_TEREDO) {
ipNumber = Number(~ipNumber & LAST_32_BITS);
} else {
ipNumber = Number(~ipNumber & LAST_32_BITS);
ipNumber = Number(ipNumber - FROM_IPV4_MAPPED_IPV6);
}

@@ -646,2 +678,6 @@ if (this.#myDB.indexed == 1) {

} else {
if (this.#myDB.dbCountIPV6 == 0) {
loadMesg(data, MSG_IPV6_UNSUPPORTED);
return;
}
firstCol = 16; // IPv6 is 16 bytes

@@ -848,3 +884,4 @@ if (this.#myDB.indexedIPV6 == 1) {

(ipNumber >= FROM_6TO4 && ipNumber <= TO_6TO4) ||
(ipNumber >= FROM_TEREDO && ipNumber <= TO_TEREDO)
(ipNumber >= FROM_TEREDO && ipNumber <= TO_TEREDO) ||
(ipNumber >= FROM_IPV4_MAPPED_IPV6 && ipNumber <= TO_IPV4_MAPPED_IPV6)
) {

@@ -859,4 +896,6 @@ ipType = 4;

ipNumber = Number((ipNumber >> BigInt(80)) & LAST_32_BITS);
} else if (ipNumber >= FROM_TEREDO && ipNumber <= TO_TEREDO) {
ipNumber = Number(~ipNumber & LAST_32_BITS);
} else {
ipNumber = Number(~ipNumber & LAST_32_BITS);
ipNumber = Number(ipNumber - FROM_IPV4_MAPPED_IPV6);
}

@@ -869,2 +908,6 @@ if (this.#myDB.indexed == 1) {

} else {
if (this.#myDB.dbCountIPV6 == 0) {
loadMesg(data, MSG_IPV6_UNSUPPORTED);
return;
}
firstCol = 16; // IPv6 is 16 bytes

@@ -1075,5 +1118,2 @@ if (this.#myDB.indexedIPV6 == 1) {

return data;
} else if (ipType == 6 && this.#myDB.dbCountIPV6 == 0) {
loadMesg(data, MSG_IPV6_UNSUPPORTED);
return data;
} else {

@@ -1127,5 +1167,2 @@ this.proxyQueryData(myIP, ipType, data, mode);

return data;
} else if (ipType == 6 && this.#myDB.dbCountIPV6 == 0) {
loadMesg(data, MSG_IPV6_UNSUPPORTED);
return data;
} else {

@@ -1501,2 +1538,2 @@ await this.proxyQueryDataAsync(myIP, ipType, data, mode);

IP2ProxyWebService: IP2ProxyWebService,
};
};