Module which checks a big number of proxy servers.
proxy-checker is a Node.js module you can use to check if proxies from a big list are working.
For example, let's say you want to connect to the website example.com, but it blocks requests from your IP. So you search on the Internet a few proxy servers to use to connect to this website. The problem is that a lot of proxies you can find are not working, or maybe they are already blocked by example.com.
With proxy-checker, you can test big lists of proxy servers to see if they work to send requests to a website.
To install the module:
npm install proxy-checker
var proxyChecker = require'proxy-checker';proxyCheckercheckProxiesFromFile// The path to the file containing proxies'/path/to/proxys.txt'// the complete URL to check the proxyurl: ''// an optional regex to check for the presence of some text on the pageregex: /Example Domain/// Callback function to be called after the checkconsole.loghost + ':' + port + ' => '+ ok + ' (status: ' + statusCode + ', err: ' + err + ')';;
The file you pass as first parameter contains the proxy servers to test. Here is an example:
123.234.321.32:8012.234.21.243:808018.104.22.168:3128#127.32.76.123:80 <= This line will be ignored
Note that thanks to the Readline API, the file is read line by line, so if your file contains thousands of lines it shouldn't be an issue.