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.
- Command-line interface
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
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:
To view the help screen for the
proxy-lists getProxies --help
To output the proxies in
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.
These are the public methods of the
ProxyLists module that allow you to get proxies, add custom proxy sources, and list existing sources.
Gets proxies from all available proxy lists.
var ProxyLists = ;// `getProxies` returns an event emitter.ProxyLists;
ipAddress: '188.8.131.52'port: 8080country: 'us'source: 'superproxies'ipAddress: '184.108.40.206'port: 3128country: 'cz'protocols: 'https'source: 'someproxysource'ipAddress: '220.127.116.11'port: 3128country: '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'/*Options to pass to puppeteer when creating a new browser instance.*/browser:headless: trueslowMo: 0timeout: 10000/*Get proxies for the specified countries.To get all proxies, regardless of country, set this option to NULL.See: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.*/protocols: 'http' 'https'/*Anonymity level.To get all proxies, regardless of anonymity level, set this option to NULL.*/anonymityLevels: 'anonymous' 'elite'/*Include proxy sources by name.Only 'freeproxylists':['freeproxylists']*/sourcesWhiteList: null/*Exclude proxy sources by name.All proxy sources except 'freeproxylists':['freeproxylists']*/sourcesBlackList: null/*Set to TRUE to have all asynchronous operations run in series.*/series: false/*Load GeoIp data for these types of IP addresses. Default is only ipv4.To include both ipv4 and ipv6:['ipv4', 'ipv6']*/ipTypes: 'ipv4'/*Default request module options. For example you could pass the 'proxy' option in this way.See for more info:*/defaultRequestOptions: null/*Directory from which sources will be loaded.*/sourcesDir: null;
The proxy object has the following properties:
- ipAddress -
stringThe IP address of the proxy.
- port -
integerThe port number of the proxy.
- country -
stringAlpha-2 country code of the country in which the proxy is geo-located.
- source -
stringThe name of the proxy list from which the proxy was gathered.
- protocols - optional
arrayAn array of protocols that the proxy supports. May contain one or more of the following:
- anonymityLevel - optional
stringThe 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.
Gets proxies from a specific proxy list.
var ProxyLists = ;// `getProxiesFromSource` returns an event emitter.ProxyLists;
Options for getProxiesFromSource Method
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
var ProxyLists = ;ProxyLists;
Your proxy source is required to return the following for each proxy:
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 -
truethen 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 -
trueyou 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.
Get list of all available proxy sources.
var ProxyLists = ;var sources = ProxyLists;
name: 'freeproxylists'homeUrl: ''name: 'gatherproxy'homeUrl: ''
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;
There are a number of ways you can contribute:
- Improve or correct the documentation - All the documentation is in this
readme.mdfile. 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.
To run all tests:
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.