antoinevastel / free_proxy_checker Goto Github PK
View Code? Open in Web Editor NEWNodeJS library without any external dependencies to check if free HTTP/SOCKS4/SOCKS5 proxies are working/up
License: MIT License
NodeJS library without any external dependencies to check if free HTTP/SOCKS4/SOCKS5 proxies are working/up
License: MIT License
It would be interesting to resolve IPs proxies to country codes/names.
To do this, we can use a free service such as
Example ip2c:
https://ip2c.org/1.0.205.8
Result:
1;TH;THA;Thailand
Example ipwhois:
https://ipwhois.app/json/1.0.205.8
Result:
{
"ip": "1.0.205.8",
"success": true,
"type": "IPv4",
"continent": "Asia",
"continent_code": "AS",
"country": "Thailand",
"country_code": "TH",
"country_flag": "https://cdn.ipwhois.io/flags/th.svg",
"country_capital": "Bangkok",
"country_phone": "+66",
"country_neighbours": "LA,MM,KH,MY",
"region": "Phuket",
"city": "Thalang District",
"latitude": 8.0320027,
"longitude": 98.3334626,
"asn": "AS23969",
"org": "TOT Public Company Limited",
"isp": "TOT Public Company Limited",
"timezone": "Asia/Bangkok",
"timezone_name": "Indochina Time",
"timezone_dstOffset": 0,
"timezone_gmtOffset": 25200,
"timezone_gmt": "GMT +7:00",
"currency": "Thai Baht",
"currency_code": "THB",
"currency_symbol": "฿",
"currency_rates": 33.562,
"currency_plural": "Thai baht",
"completed_requests": 2
}
I think it would be more interesting to use a Proxy Judge like azenv.php
to test the proxies (see: http://azenv.net/, http://httpheader.net/azenv.php).
Moreover with a Proxy Judge we can know what is
For a better understanding of the progress of the proxies checks, here is an example of code using an flexible ascii progress bar: node-progress.
Rem: Pool
is not accessible via require('free-proxy-checker')
// https://github.com/antoinevastel/free_proxy_checker
const { ProxyChecker, downloadAllProxies, } = require('free-proxy-checker');
// https://github.com/visionmedia/node-progress
const ProgressBar = require('progress');
const { Pool } = require('./pool.js');
class ProgressProxyChecker extends ProxyChecker {
async checkProxies() {
this.lastCheck = Date.now();
const pool = new Pool(this.options.concurrency);
const pbar = new ProgressBar('Checking proxies [:bar] :percent :etas', {
complete: '=',
incomplete: ' ',
width: 20,
total: this.proxies.length
});
this.proxies.forEach((proxy) => {
pool.addTask(async() => {
try {
await proxy._testConnection(this.options.timeout);
} catch (_) { }
finally {
if (this.options.verbose) {
pbar.tick();
}
}
})
})
await pool.run();
}
}
(async () => {
// Clear console
process.stdout.write('\033c');
// Download all proxies from all proxy providers at once
const allProxies = await downloadAllProxies();
console.log(`There are ${allProxies.length} proxies to test`);
// Check the availability of the proxies we downloaded
const proxyChecker = new ProgressProxyChecker(allProxies, {
concurrency: 50,
timeout: 7500,
verbose: true
})
await proxyChecker.checkProxies();
const proxiesUp = proxyChecker.getProxiesUp();
console.log(`There are ${proxiesUp.length} proxies UP:`);
})();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.