puppyproxy 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/PuppyProxy.js
CHANGED
|
@@ -12,7 +12,7 @@ export default class PuppyProxy {
|
|
|
12
12
|
/**
|
|
13
13
|
* @param {Object} config - The configuration object
|
|
14
14
|
*/
|
|
15
|
-
constructor(config) {
|
|
15
|
+
constructor(config = {}) {
|
|
16
16
|
this.config = config;
|
|
17
17
|
this.config.storeDir = this.config.storeDir || this.resolveDataDir();
|
|
18
18
|
console.log("Using data store directory:", this.config.storeDir);
|
package/src/providers/Scraper.js
CHANGED
|
@@ -95,7 +95,7 @@ export default class Scraper {
|
|
|
95
95
|
let lastSaved = (Date.now() - getLastSavedTimestamp(this.outputPath)) / 1000; // ms to seconds
|
|
96
96
|
if (lastSaved && !force) {
|
|
97
97
|
console.log("lastSaved", lastSaved);
|
|
98
|
-
let timeBetweenScrapes = this.config
|
|
98
|
+
let timeBetweenScrapes = (this.config?.scraper?.timeBetweenScrapes || 10) * 60; // mins to seconds
|
|
99
99
|
if (lastSaved < timeBetweenScrapes) {
|
|
100
100
|
console.log(`Proxies saved < ${timeBetweenScrapes}s ago, skipping.`);
|
|
101
101
|
return;
|
package/src/workers/collector.js
CHANGED
|
@@ -71,7 +71,7 @@ async function checkProxy(socksOrHttpProxy) {
|
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
const maxTimeAllowed = config.scraper.timeoutMax; //in seconds, lower for less proxies but higher quality
|
|
74
|
+
const maxTimeAllowed = config.scraper.timeoutMax || 15; //in seconds, lower for less proxies but higher quality
|
|
75
75
|
|
|
76
76
|
let method = config.scraper.method || "http"; // 'ws' or 'http'
|
|
77
77
|
const wsUrl = config.scraper.wsUrl || 'wss://shellshock.io/matchmaker/';
|