Proxy Scraper
Library for Node.js for proxy collection and validation
Install
OS Dependencies
Lib Dependencies
JSDoc
Usage example
const SocksScraper = require('socks-scraper');
const socksScraper = new SocksScraper([
"https://raw.githubusercontent.com/casals-ar/proxy-list/main/socks5",
"https://raw.githubusercontent.com/casals-ar/proxy-list/main/socks4",
"https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/socks4.txt",
"https://raw.githubusercontent.com/ShiftyTR/Proxy-List/master/socks4.txt",
"https://shieldcommunity.net/sockets.txt"
])
socksScraper.addSites(["https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks4.txt"])
const timeout = 6000
console.log('Updating unchecked proxies...');
await socksScraper.updateUncheckedProxies()
console.log('Done updating unchecked proxies!');
const wsp4 = await socksScraper.getWorkedSocksProxies(4, timeout)
const bestWSP4 = SocksScraper.filterByLatency(wsp4)[0]
console.log(`The best socks4 proxy is ${bestWSP4.host}:${bestWSP4.port} with latency ${bestWSP4.latency}ms`)
const wsp5 = await socksScraper.getWorkedSocksProxies(5, timeout, 1, 20000)
const bestWSP5 = SocksScraper.filterByLatency(wsp5)[0]
console.log(`The best socks5 proxy is ${bestWSP5.host}:${bestWSP5.port} with latency ${bestWSP5.latency}ms`)
const mySocks5Proxy = await SocksScraper.checkSocksProxy(5, '94.131.14.66:1080', 4000)
const isAlive = Boolean(mySocks5Proxy)
console.log(`My socks5 proxy is ${isAlive ? 'alive' : 'dead'}`)
console.log(mySocks5Proxy)
My socks5 proxy is alive!
{
address: '3.122.84.99:3128',
host: '3.122.84.99',
port: 3128,
latency: 32
}