Giter Site home page Giter Site logo

proxy-lists's Introduction

proxy-lists

Build Status

Node.js module for getting proxies from publicly available proxy lists. Support for more than two dozen different proxy lists. You can see the full list of proxy sources here.

Missing a proxy list that you think should be supported? Open an issue to suggest it be added as a source. Or you can add a new source and create a pull request to have it added to this module.

Installation

If you wish to use this module as a CLI tool, install it globally via npm:

npm install -g proxy-lists

Otherwise, you can add it to your existing node application like this:

npm install proxy-lists --save

This will install proxy-lists and add it to your application's package.json file.

Update GeoIp Database

This module uses geoip-lite to perform geoip-country lookups on IP addresses of proxies. The geoip-lite module ships with the free version of MaxMind's geoip database. This database stopped being directly included in the module due to a change on MaxMind's side - specifically with their end-user licensing agreements. So it is necessary for each end-user (that's you!) to create their own MaxMind account and then generate a license key.

If you are using this module inside another project (via the API), use the following command to update the geoip database:

npm run update:geoip-database license_key=YOUR_LICENSE_KEY

If you are using the CLI:

proxy-lists updateGeoIpData --license-key YOUR_LICENSE_KEY

Command-line interface

This section assumes that you have proxy-lists installed globally and that it is available on your current user's PATH.

To view the help screen for the CLI tool:

proxy-lists --help

To view the help screen for the getProxies command:

proxy-lists getProxies --help

To output the proxies in .txt format:

proxy-lists getProxies --output-format="txt"

To output proxies to STDOUT:

proxy-lists getProxies --stdout

To output proxies to a different file than proxies.txt:

proxy-lists getProxies --output-file="somefile.txt"

To get proxies from specific sources:

proxy-lists getProxies --sources-white-list="gatherproxy,sockslist"

To get proxies from specific countries:

proxy-lists getProxies --countries="us,ca"

To get proxies with specific protocols:

proxy-lists getProxies --protocols="http,https"

To get only anonymous and elite proxies:

proxy-lists getProxies --anonymity-levels="anonymous,elite"

The output of the getProxies command is written to a new file (proxies.txt) in your current working directory.

API

These are the public methods of the ProxyLists module that allow you to get proxies, add custom proxy sources, and list existing sources.

getProxies

getProxies([options])

Gets proxies from all available proxy lists.

Usage:

var ProxyLists = require('proxy-lists');

// `getProxies` returns an event emitter.
ProxyLists.getProxies({
	// options
	countries: ['us', 'ca']
})
	.on('data', function(proxies) {
		// Received some proxies.
		console.log('got some proxies');
		console.log(proxies);
	})
	.on('error', function(error) {
		// Some error has occurred.
		console.log('error!', error);
	})
	.once('end', function() {
		// Done getting proxies.
		console.log('end!');
	});

Sample proxies:

[
	{
		ipAddress: '123.123.2.42',
		port: 8080,
		country: 'us',
		source: 'superproxies'
	},
	{
		ipAddress: '234.221.233.142',
		port: 3128,
		country: 'cz',
		protocols: ['https'],
		source: 'someproxysource'
	},
	{
		ipAddress: '234.221.233.142',
		port: 3128,
		country: 'cz',
		anonymityLevel: 'elite',
		protocols: ['https'],
		source: 'anotherproxysource'
	}
]

Options for getProxies Method

var options = {
	/*
		The filter mode determines how some options will be used to exclude proxies.

		For example if using this option `anonymityLevels: ['elite']`:
			'strict' mode will only allow proxies that have the 'anonymityLevel' property equal to 'elite'; ie. proxies that are missing the 'anonymityLevel' property will be excluded.
			'loose' mode will allow proxies that have the 'anonymityLevel' property of 'elite' as well as those that are missing the 'anonymityLevel' property.
	*/
	filterMode: 'strict',

	/*
		Whether or not to emit only unique proxies (HOST:PORT).
	*/
	unique: true,

	/*
		Get proxies for the specified countries.

		To get all proxies, regardless of country, set this option to NULL.

		See:
		https://en.wikipedia.org/wiki/ISO_3166-1

		Only USA and Canada:
		['us', 'ca']
	*/
	countries: null,

	/*
		Exclude proxies from the specified countries.

		To exclude Germany and Great Britain:
		['de', 'gb']
	*/
	countriesBlackList: null,

	/*
		Get proxies that use the specified protocols.

		To get all proxies, regardless of protocol, set this option to NULL.

		To get proxies with specified protocols:
		['socks4', 'socks5']
	*/
	protocols: null,

	/*
		Anonymity level.

		To get all proxies, regardless of anonymity level, set this option to NULL.

		To get proxies with specified anonymity-levels:
		['elite', 'anonymous']
	*/
	anonymityLevels: null,

	/*
		Include proxy sources by name.

		Only 'freeproxylists':
		['freeproxylists']
	*/
	sourcesWhiteList: null,

	/*
		Exclude proxy sources by name.

		All proxy sources except 'freeproxylists':
		['freeproxylists']
	*/
	sourcesBlackList: null,

	/*
		Full path to the sources directory.
	*/
	sourcesDir: path.join(__dirname, 'sources'),

	/*
		Set to TRUE to have all asynchronous operations run in series.
	*/
	series: false,

	/*
		Options to pass to puppeteer when creating a new browser instance.
	*/
	browser: {
		headless: true,
		slowMo: 0,
		timeout: 10000,
	},

	/*
		Default request module options. For example you could pass the 'proxy' option in this way.

		See for more info:
		https://github.com/request/request#requestdefaultsoptions
	*/
	defaultRequestOptions: null,

	/*
		Use a queue to limit the number of simultaneous HTTP requests.
	*/
	requestQueue: {
		/*
			The maximum number of simultaneous requests.
		*/
		concurrency: 1,
		/*
			The time (in milliseconds) between each request. Set to 0 for no delay.
		*/
		delay: 0,
	},
};

Proxy Object

The proxy object has the following properties:

  • ipAddress - string The IP address of the proxy.
  • port - integer The port number of the proxy.
  • country - string Alpha-2 country code of the country in which the proxy is geo-located.
  • source - string The name of the proxy list from which the proxy was gathered.
  • protocols - optional array An array of protocols that the proxy supports. May contain one or more of the following:
    • http - The proxy uses HTTP.
    • https - The proxy uses HTTPS.
    • socks5 - The proxy server uses the socks5 protocol.
    • socks4 - The proxy server uses the socks4 protocol.
  • anonymityLevel - optional string The anonymity level of the proxy. Can be any one of the following:
    • transparent - The proxy does not hide the requester's IP address.
    • anonymous - The proxy hides the requester's IP address, but adds headers to the forwarded request that make it clear that the request was made using a proxy.
    • elite - The proxy hides the requester's IP address and does not add any proxy-related headers to the request.

The attributes marked as optional above might not be given for all proxies. Some proxy lists are missing this information.

It's important to note that this module does NOT verify all of the information provided by the proxy lists from which the proxies are gathered. If you need to check that proxies work, verify their anonymity level, whether or not they support tunneling; use proxy-verifier.

getProxiesFromSource

getProxiesFromSource(name, [options])

Gets proxies from a specific proxy list.

Usage:

var ProxyLists = require('proxy-lists');

// `getProxiesFromSource` returns an event emitter.
ProxyLists.getProxiesFromSource('freeproxylists', {
	anonymityLevels: ['elite']
})
	.on('data', function(proxies) {
		// Received some proxies.
		console.log('got some proxies');
		console.log(proxies);
	})
	.on('error', function(error) {
		// Some error has occurred.
		console.log('error!', error);
	})
	.once('end', function() {
		// Done getting proxies.
		console.log('end!');
	});

Options for getProxiesFromSource Method

See Options for getProxies Method.

addSource

addSource(name, source)

Add a custom proxy source to the list of available proxies. The new proxy source will be used in addition to the existing sources, when calling getProxies().

Usage:

var ProxyLists = require('proxy-lists');

ProxyLists.addSource('my-custom-source', {
	homeUrl: 'https://somewhere.com',
	getProxies: function(options) {

		var emitter = options.newEventEmitter();

		_.defer(function() {
			// When an error occurs, use the 'error' event.
			// The 'error' event can be emitted more than once.
			emitter.emit('error', new Error('Something bad happened!'));

			// When proxies are ready, use the 'data' event.
			// The 'data' event can be emitted more than once.
			emitter.emit('data', proxies);

			// When done getting proxies, emit the 'end' event.
			// The 'end' event should be emitted once.
			emitter.emit('end');
		});

		// Must return an event emitter.
		return emitter;
	}
});

Your proxy source is required to return the following for each proxy: ipAddress, port. See Proxy Object above for more information.

Please consider sharing your custom proxy sources by creating a pull request to have them added to this module so that others can use them too.

Important Options to Note

Please note that there are a couple options that you should respect in your custom proxy source:

  • sample - boolean If options.sample is true then you should do your best to make the fewest number of HTTP requests to the proxy source but still get at least some real proxies. The purpose of this option is to reduce the strain caused by this module's unit tests on each proxy sources' servers.
  • series - boolean If options.series is true you should make sure that all asynchronous code in your custom source is run in series, NOT parallel. The purpose is to reduce the memory usage of the module so that it can be run in low-memory environments such as a VPS with 256MB of RAM.

listSources

listSources([options])

Get list of all available proxy sources.

Usage:

var ProxyLists = require('proxy-lists');

var sources = ProxyLists.listSources();

Sample sources:

[
	{
		name: 'freeproxylists',
		homeUrl: 'http://www.freeproxylists.com'
	},
	{
		name: 'gatherproxy',
		homeUrl: 'http://www.gatherproxy.com'
	}
]

Options for listSources Method

var options = {
	/*
		Include proxy sources by name.

		Only 'freeproxylists':
		['freeproxylists']
	*/
	sourcesWhiteList: null,

	/*
		Exclude proxy sources by name.

		All proxy sources except 'freeproxylists':
		['freeproxylists']
	*/
	sourcesBlackList: null
};

Usage with Proxy

It is possible to use a proxy while getting proxies, using the "browser" and "defaultRequestOptions" options. This module uses both request and puppeteer under-the-hood to scrape web pages. So you will have to configure both of those to use a proxy while getting proxies from every possible source.

Here is an example using the API:

var ProxyLists = require('proxy-lists');

ProxyLists.getProxies({
	browser: {
		// arguments passed to puppeteer browser instance:
		args: [ '--proxy-server=127.0.0.1:9876' /* your proxy */ ]
	},
	defaultRequestOptions: {
		// Passed as default options to the request module.
		// Read the following for details about proxy usage and request:
		// https://github.com/request/request#proxies
		proxy: 'http://127.0.0.1:9876',
	}
})
	.on('data', function(proxies) {
		console.log(proxies);
	});

It is not currently possible to pass the above options via the CLI. But if you'd like to add this feature, pull requests are welcome ;)

Contributing

There are a number of ways you can contribute:

  • Improve or correct the documentation - All the documentation is in this readme.md file. If you see a mistake, or think something should be clarified or expanded upon, please submit a pull request
  • Report a bug - Please review existing issues before submitting a new one; to avoid duplicates. If you can't find an issue that relates to the bug you've found, please create a new one.
  • Request a feature - Again, please review the existing issues before posting a feature request. If you can't find an existing one that covers your feature idea, please create a new one.
  • Fix a bug - Have a look at the existing issues for the project. If there's a bug in there that you'd like to tackle, please feel free to do so. I would ask that when fixing a bug, that you first create a failing test that proves the bug. Then to fix the bug, make the test pass. This should hopefully ensure that the bug never creeps into the project again. After you've done all that, you can submit a pull request with your changes.

Configure Local Environment

Step 1: Get the Code

First, you'll need to pull down the code from GitHub:

git clone https://github.com/chill117/proxy-lists.git

Step 2: Install Dependencies

Second, you'll need to install the project dependencies as well as the dev dependencies. To do this, simply run the following from the directory you created in step 1:

npm install

Tests

This project includes an automated regression test suite. To run the tests:

npm test

Changelog

See changelog.md

License

This software is MIT licensed:

A short, permissive software license. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. There are many variations of this license in use.

Funding

This project is free and open-source. If you would like to show your appreciation by helping to fund the project's continued development and maintenance, you can find available options here.

proxy-lists's People

Contributors

behindthemath avatar chill117 avatar csandman avatar damdev avatar harshitjoshi avatar hoducha avatar jerradpatch avatar pepzwee avatar stylesuxx avatar vadimmarkelov avatar wfoojjaec avatar yarafan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxy-lists's Issues

Re-design the API interface to allow for more stream-like behavior

Why

Now when calling getProxies() it takes a very long time before the callback is called. This long delay is due to waiting for proxies to be gathered from all sources. Not only is it annoying to have to wait so long before receiving any proxy data, it has a huge disadvantage in that all the proxy data is stored in memory leading to unnecessarily high memory consumption.

How to solve this

The sources and the module's interface functions must be designed to allow for a stream-like interface. At a high level, as soon as some data is ready to pass on to further processing, it should be. And as soon as proxy data is ready it should be delivered via a callback or stream interface.

Event-based solution:

ProxyLists.getProxies(options).on('data', function(proxies) {
    // Can be called any number of times.
    // `proxies` will contain an array of proxies as before.
}).on('error', function(error) {
    // Some error occurred.
    console.error(error);
}).on('end', function() {
    // Done getting proxies.
});

Error: Invalid protocol: null

Hi @chill117 ,

I try to fetch some proxy but it seems it return Error: Invalid protocol: null error for many of proxy sources. Is it a bug or I use package in wrong way?

Use proxy in proxy-list

Hi @chill117 ,
Is it possible to set proxy for proxy-list module?? For example pass proxy option through request proxy options.
Some proxy source block my IP and I want to set proxy when use proxy-list.

Countries black list

Add a --countries-black-list similar to the --sources-black-list. This would make it easier to grab all proxies except for China for example.

Test failing for proxies24

Pretty sure this was working last week, but the test for proxies24 is failing:

AssertionError: expected [ Array(1) ] to deeply equal []
      + expected - actual

      -[
      -  {
      -    "ipAddress": "838.67.208.17"
      -    "port": 45554
      -    "protocols": [
      -      "socks5"
      -    ]
      -  }
      -]
      +[]

This seems to be because of the invalid IP address. The proxy is pushed on the invalid proxy list. Not sure if the test should fail - I guess internally such proxies are excluded.

freeproxylists parser causes thrown exception

TypeError: Cannot read property 'quote' of undefined
    at node_modules\proxy-lists\sources\freeproxylists.js:211:36
    at Parser.<anonymous> (node_modules\xml2js\lib\xml2js.js:489:18)
    at emitOne (events.js:90:13)
    at Parser.emit (events.js:182:7)
    at Object.onclosetag (node_modules\xml2js\lib\xml2js.js:447:26)
    at emit (node_modules\sax\lib\sax.js:640:35)
    at emitNode (node_modules\sax\lib\sax.js:645:5)
    at closeTag (node_modules\sax\lib\sax.js:905:7)
    at Object.write (node_modules\sax\lib\sax.js:1449:13)
    at Parser.exports.Parser.Parser.parseString (node_modules\xml2js\lib\xml2js.js:508:31)
    at Parser.parseString (node_modules\xml2js\lib\xml2js.js:7:59)
    at exports.parseString (node_modules\xml2js\lib\xml2js.js:540:19)
    at module.exports.parseListData (node_modules\proxy-lists\sources\freeproxylists.js:204:3)
    at node_modules\proxy-lists\node_modules\async\dist\async.js:2535:20
    at node_modules\proxy-lists\node_modules\async\dist\async.js:2476:13
    at replenish (node_modules\proxy-lists\node_modules\async\dist\async.js:884:21)
    at iterateeCallback (node_modules\proxy-lists\node_modules\async\dist\async.js:869:21)
    at node_modules\proxy-lists\node_modules\async\dist\async.js:847:20
    at node_modules\proxy-lists\node_modules\async\dist\async.js:2478:17
    at node_modules\proxy-lists\node_modules\async\dist\async.js:2536:21
    at node_modules\proxy-lists\node_modules\async\dist\async.js:339:31
    at Request._callback (node_modules\proxy-lists\sources\freeproxylists.js:182:4)

TypeError: Cannot read property 'indexOf' of null

I've installed proxy-lists:
$ npm install -g proxy-lists

After I've got this error when I'd like to get a proxy list:
$ proxy-lists getProxies --sources-white-list="hidemyass" --stdout
TypeError: Cannot read property 'indexOf' of null

How can I get a proxy list?

CLI: Output format stdout

I was wondering if it is possible to simply write the proxies to stdout instead of a file?

I am running multiple instances in the same folder and do this for a workaround:

cd tmp/http && proxy-lists getProxies --sources-white-list="hidemyass" --protocols="http" > /dev/null 2>&1 && cat proxies.txt

If I could write to stdout I could simply redirect the output, without this ugly construct ;-)

Test failing for hidemyass

Hey it is me again, I hope I do not annoy you too much,...

Test for hidemyass is failing:

  1) source.getProxies([options, ]cb) source.hidemyass should return valid proxies:
     TypeError: Cannot read property 'toString' of undefined
    at Object.<anonymous> (sources/hidemyass.js:135:48)
    at [object Object].exports.each (node_modules/cheerio/lib/api/traversing.js:300:24)
    at module.exports.parseResponseData (sources/hidemyass.js:128:12)
    at node_modules/async/dist/async.js:2718:16
    at node_modules/async/dist/async.js:2659:9
    at replenish (node_modules/async/dist/async.js:1030:17)
    at iterateeCallback (node_modules/async/dist/async.js:1015:17)
    at node_modules/async/dist/async.js:988:16
    at node_modules/async/dist/async.js:2661:13
    at node_modules/async/dist/async.js:2719:17
    at apply (node_modules/async/dist/async.js:41:25)
    at node_modules/async/dist/async.js:76:12
    at Request._callback (sources/hidemyass.js:115:4)
    at Request.self.callback (node_modules/request/request.js:187:22)
    at Request.<anonymous> (node_modules/request/request.js:1048:10)
    at IncomingMessage.<anonymous> (node_modules/request/request.js:969:12)
    at endReadableNT (_stream_readable.js:906:12)

I guess this is because http://proxylist.hidemyass.com/ is not showing any proxies. In this case I guess it is good that the test is failing, since it tells us that something with the source is wrong, but still I think it should fail controlled at https://github.com/chill117/proxy-lists/blob/master/test/unit/sources/index.js#L98

gatherproxy causes thrown exception

cyclops24 wrote:

Today my app crash with below code adn server restarted:

W20160805-21:31:20.135(4.5)? (STDERR) /home/username/Projects/Proxy Assistant/Sources/node_modules/proxy-lists/sources/gatherproxy.js:313
W20160805-21:31:20.136(4.5)? (STDERR)         return cookie.substr(0, cookie.indexOf(';'));
W20160805-21:31:20.137(4.5)? (STDERR)                      ^
W20160805-21:31:20.137(4.5)? (STDERR) 
W20160805-21:31:20.137(4.5)? (STDERR) TypeError: Cannot read property 'substr' of undefined
W20160805-21:31:20.138(4.5)? (STDERR)     at Object.module.exports.getSessionCookie (/home/username/Projects/Proxy Assistant/Sources/node_modules/proxy-lists/sources/gatherproxy.js:313:16)
W20160805-21:31:20.138(4.5)? (STDERR)     at Request._callback (/home/username/Projects/Proxy Assistant/Sources/node_modules/proxy-lists/sources/gatherproxy.js:211:24)
W20160805-21:31:20.139(4.5)? (STDERR)     at Request.self.callback (/home/username/Projects/Proxy Assistant/Sources/node_modules/request/request.js:200:22)
W20160805-21:31:20.139(4.5)? (STDERR)     at emitTwo (events.js:87:13)
W20160805-21:31:20.139(4.5)? (STDERR)     at Request.emit (events.js:172:7)
W20160805-21:31:20.140(4.5)? (STDERR)     at Request.<anonymous> (/home/username/Projects/Proxy Assistant/Sources/node_modules/request/request.js:1067:10)
W20160805-21:31:20.140(4.5)? (STDERR)     at emitOne (events.js:82:20)
W20160805-21:31:20.140(4.5)? (STDERR)     at Request.emit (events.js:169:7)
W20160805-21:31:20.140(4.5)? (STDERR)     at IncomingMessage.<anonymous> (/home/username/Projects/Proxy Assistant/Sources/node_modules/request/request.js:988:12)
W20160805-21:31:20.141(4.5)? (STDERR)     at emitNone (events.js:72:20)
=> Exited with code: 1

I think manybe gatherproxy breaks. I think it's better to prevent server restart on error's like this or this.

Get a specific number of proxies

Hello,

I have a use case where I know the number of proxies I need so it is not very efficient to get the full list just to use a few.
Would it be possible to add an option that sets the number of proxies to return?

Error: Missing required option (`option.bitproxies.apiKey`)

proxy-lists getProxies --countries="'us, ca"

Getting proxies...
Error: Missing required option (option.bitproxies.apiKey): You can get an API key for this service by creating an account at https://bitproxies.eu/
Error: Missing required option (option.kingproxies.apiKey): You can get an API key for this service by creating an account at https://kingproxies.com/register
Writing output to C:\Users\ADMIN\Desktop\appsearch\myapp/proxies.txt
TypeError: Cannot read property 'toString' of undefined

how to fix error.

Geo-ip lookup if country is missing

Several proxy sources don't have any information other than an IP address and port. In these cases, the IP address can be used to lookup the country code of the proxy. Add an option that when used will tell proxy-lists to perform this lookup for all proxies that are missing the country information. No option is used. Every proxy's IP address is geo-located automatically.

Broken parsers

hidemyass.js not parsing - the proxy list is no longer accessible by the link indicated in the module.
blackhatworld.js not parsing - TypeError: Cannot read property 'toString' of undefined (on line 101-102)

getProxies break for source "proxydb"

When invoking getProxies(), it always give the following:

Uncaught Error: Invalid option "countries": Object expected.
      at Object.module.exports.filterProxies (node_modules/proxy-lists/index.js:240:11)
      at EventEmitter.<anonymous> (node_modules/proxy-lists/index.js:157:26)
      at node_modules/proxy-lists/sources/proxydb.js:57:13
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2722:16
      at node_modules/proxy-lists/node_modules/async/dist/async.js:484:16
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2664:9
      at node_modules/proxy-lists/node_modules/async/dist/async.js:484:16
      at replenish (node_modules/proxy-lists/node_modules/async/dist/async.js:1025:25)
      at iterateeCallback (node_modules/proxy-lists/node_modules/async/dist/async.js:1015:17)
      at node_modules/proxy-lists/node_modules/async/dist/async.js:988:16
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2661:13
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2719:17
      at apply (node_modules/proxy-lists/node_modules/async/dist/async.js:41:25)
      at node_modules/proxy-lists/node_modules/async/dist/async.js:76:12
      at module.exports.parsePageHtml (node_modules/proxy-lists/sources/proxydb.js:137:3)
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2718:16
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2659:9
      at replenish (node_modules/proxy-lists/node_modules/async/dist/async.js:1030:17)
      at iterateeCallback (node_modules/proxy-lists/node_modules/async/dist/async.js:1015:17)
      at node_modules/proxy-lists/node_modules/async/dist/async.js:988:16
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2661:13
      at node_modules/proxy-lists/node_modules/async/dist/async.js:2719:17
      at apply (node_modules/proxy-lists/node_modules/async/dist/async.js:41:25)
      at node_modules/proxy-lists/node_modules/async/dist/async.js:76:12
      at Request._callback (node_modules/proxy-lists/sources/proxydb.js:104:4)
      at Request.self.callback (node_modules/proxy-lists/node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/proxy-lists/node_modules/request/request.js:1081:10)
      at IncomingMessage.<anonymous> (node_modules/proxy-lists/node_modules/request/request.js:1001:12)
      at endReadableNT (_stream_readable.js:921:12)

After tracing, I found the following happened along with proxies data of "proxydb". So I find the following lines in "proxydb.js":
https://github.com/chill117/proxy-lists/blob/master/sources/proxydb.js#L33-L35

As "option.countries" expecting object, is that underscore.js call "map" the cause of problem? Say, using "_.mapObject" instead.
http://underscorejs.org/#mapObject

Thanks for your help. This project is a nice work!

Not working for node v0.10

Hi,
I try use your package as below but I got error:

var ProxyLists = require('proxy-lists');

var options = {
    anonymityLevels: ['anonymous', 'elite']
};

// `gettingProxies` is an event emitter object. 
var gettingProxies = ProxyLists.getProxies(options);

gettingProxies.on('data', function(proxies) {
    // Received some proxies. 
    console.log(proxies);
});

gettingProxies.on('error', function(error) {
    // Some error has occurred. 
    console.error(error);
});

gettingProxies.once('end', function() {
    // Done getting proxies. 
});

And this is my error message:

/media/username/projects/ProxyFetcher/node_modules/proxy-lists/index.js:70
        var emitter = new EventEmitter();
                      ^
TypeError: object is not a function
    at Object.module.exports.getProxies (/media/username/projects/ProxyFetcher/node_modules/proxy-lists/index.js:70:17)
    at Object.<anonymous> (/media/username/projects/ProxyFetcher/proxyFetcher.js:8:33)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

where is my mistake?

use test as sync function

Hi @chill117 ,
I try using this library for check some proxies but after some check it's return Maximum number of open connections reached. message.
How we can use test function as sync function.
Can you help me?

I m getting following error in running proxy-lists CLI command

nishant@nishant-sjsu:~/workspacejs$ proxy-lists --help

module.js:340
throw err;
^
Error: Cannot find module '.'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/proxy-lists/cli.js:10:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
nishant@nishant-sjsu:~/workspacejs$

Disable logs

Hello,
Is there a way to disable logs when using --stdout?
I tried running proxy-lists getProxies -l /dev/null --stdout but it seems it always looks for a local file:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open '/media/pierre/Data/www/alltube//dev/null'
    at Error (native)

TypeError: options.request is not a function

This error always shows when executing "proxy-lists getProxies": TypeError: options.request is not a function

I've tested this on a Windows and Linux machine and the results are the same: The code stops and doesn't write proxies to a text file.

Error: ETIMEDOUT

Hi @chill117
I got this error when try use your package within Meteor:

Error: ETIMEDOUT
W20160515-11:16:07.801(4.5)? (STDERR)     at [object Object]._onTimeout (/home/cy/Programming/Projects/proxyCheck/Sources/node_modules/proxy-lists/node_modules/request/request.js:762:15)
W20160515-11:16:07.801(4.5)? (STDERR)     at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

It return many proxy but also return this error. This is my code:

Meteor.methods({
    proxyFetcher() {
        console.log("OK run");
        var options = {
            protocols: ['http'],
            anonymityLevels: ['elite'],
            sourcesBlackList: ['bitproxies', 'kingproxies']
        };

        var gettingProxies = ProxyLists.getProxies(options);
        Proxies.remove({});

        gettingProxies.on('data', Meteor.bindEnvironment(function(proxies) {
            console.log(proxies.length);
            proxies.forEach((proxy) => {
                Proxies.insert({proxy: proxy.ipAddress + ":" + proxy.port});
            });
            // Received some proxies.
        }));
    }
}

Save as text (export)

Hi @chill117 ,
I guess a simple export feature maybe useful. Many people want to export this module result as a standard proxy list text file (IP:PORT).

Samair proxies

http://samair.ru/proxy/

They're paginated into pages like http://samair.ru/proxy/list-IP-port/proxy-5.htm. They have a free list of 600 proxies that are checked pretty frequently.

Gatherproxy: could not find download link

How to reproduce:

  • Just a fresh install and run the default cli command

Error code:

Error: Could not find download link.
    at Request._callback (/home/arfianadam/work/adam/web-bot/node_modules/proxy-lists/sources/gatherproxy.js:80:15)
    at Request.self.callback (/home/arfianadam/work/adam/web-bot/node_modules/proxy-lists/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/arfianadam/work/adam/web-bot/node_modules/proxy-lists/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/home/arfianadam/work/adam/web-bot/node_modules/proxy-lists/node_modules/request/request.js:1001:12)
    at IncomingMessage.g (events.js:291:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)

any fix to this?
regardless, thank you for making this!

Error: connect ECONNREFUSED 112.215.37.181:443

How to reproduce:

  • Just a fresh install and run the default cli command

Error code:

{ Error: connect ECONNREFUSED 112.215.37.181:443
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '112.215.37.181',
  port: 443 }

any thoughts? thanks!

Error: ETIMEDOUT

How to reproduce:

  • Fresh install
  • proxy-lists getProxies

Log:

{ Error: ETIMEDOUT
    at Timeout._onTimeout (/home/arfianadam/work/adam/web-bot/node_modules/request/request.js:813:19)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5) code: 'ETIMEDOUT', connect: true }

But after some time it returns Done! and the proxy list is updated.

throw new Error('Data (' + ipType + ') has not been loaded.');

Hi Chill117,
I've got below exception today.
Maybe one of the sources returned ipv6 address?
It seems ipv6 was disabled by default when invoking GeoIpNativeLite.loadDataSync and there is no any way to enable it.

2016-11-24T13:24:09.725112+00:00 app[web.1]: /app/node_modules/geoip-native-lite/index.js:24
2016-11-24T13:24:09.725115+00:00 app[web.1]: throw new Error('Data (' + ipType + ') has not been loaded.');
2016-11-24T13:24:09.725116+00:00 app[web.1]: ^
2016-11-24T13:24:09.725116+00:00 app[web.1]:
2016-11-24T13:24:09.725117+00:00 app[web.1]: Error: Data (ipv6) has not been loaded.
2016-11-24T13:24:09.725118+00:00 app[web.1]: at Object.module.exports.lookup (/app/node_modules/geoip-native-lite/index.js:24:10)
2016-11-24T13:24:09.725119+00:00 app[web.1]: at /app/node_modules/proxy-lists/index.js:133:37
2016-11-24T13:24:09.725120+00:00 app[web.1]: at Function..map..collect (/app/node_modules/underscore/underscore.js:172:24)
2016-11-24T13:24:09.725121+00:00 app[web.1]: at EventEmitter. (/app/node_modules/proxy-lists/index.js:131:16)
2016-11-24T13:24:09.725121+00:00 app[web.1]: at emitOne (events.js:90:13)
2016-11-24T13:24:09.725122+00:00 app[web.1]: at EventEmitter.emit (events.js:182:7)
2016-11-24T13:24:09.725123+00:00 app[web.1]: at /app/node_modules/proxy-lists/sources/proxydb.js:50:13
2016-11-24T13:24:09.725123+00:00 app[web.1]: at /app/node_modules/async/dist/async.js:2722:16
2016-11-24T13:24:09.725124+00:00 app[web.1]: at /app/node_modules/async/dist/async.js:484:16
2016-11-24T13:24:09.725125+00:00 app[web.1]: at /app/node_modules/async/dist/async.js:2664:9

Add `series` option for getting proxies non-concurrently

Currently, proxies are retrieved from all proxy sources concurrently; each proxy source also performs HTTP requests and other processing concurrently. This can be an issue when run in an environment with limited system resources. Adding a new option (series) could solve this problem.

series should default to false to maintain the current behavior.

When series is set to true, all asynchronous functions should be run in series as opposed to in parallel.

Affected methods:

  • getProxies()
  • getProxiesFromSource()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.