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

socks-scraper

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socks-scraper - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

42

index.js

@@ -96,10 +96,14 @@ const { SocksClient } = require('socks');

* @param {string} url
* @returns {Promise<string[]>}
* @returns {Promise<string[] | []>}
*/
async getProxiesFromRawSite(url) {
const response = await request(url, { method: "GET", headers: this.headers })
const responseText = await response.body.text()
try {
const response = await request(url, { method: "GET", headers: this.headers })
const responseText = await response.body.text()
const proxyList = responseText.split('\n').filter((x) => x.match(ipPortRegex))
return proxyList
const proxyList = responseText.split('\n').filter((x) => x.match(ipPortRegex))
return proxyList
} catch (error) {
return []
}
}

@@ -116,16 +120,20 @@

async checkSocksProxy(type, address, timeout = 5000) {
const [host, portStr] = address.split(':');
const port = Number(portStr);
try {
const [host, portStr] = address.split(':');
const port = Number(portStr);
const startTime = performance.now();
const result = await SocksClient.createConnection({
timeout,
command: 'connect',
destination: { host: this.checkURL, port: this.checkURLPort },
proxy: { host, port, type }
})
.then(() => ({ address, host, port, latency: Math.round(performance.now() - startTime) }))
.catch(() => null);
const startTime = performance.now();
const result = await SocksClient.createConnection({
timeout,
command: 'connect',
destination: { host: this.checkURL, port: this.checkURLPort },
proxy: { host, port, type }
})
.then(() => ({ address, host, port, latency: Math.round(performance.now() - startTime) }))
.catch(() => null);
return result;
return result;
} catch (error) {
return null
}
}

@@ -132,0 +140,0 @@

@@ -7,3 +7,3 @@ {

"name": "socks-scraper",
"version": "1.0.0",
"version": "1.0.1",
"description": "Uses your references to obtain and verify proxies ",

@@ -10,0 +10,0 @@ "main": "index.js",

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