项目作者: indatawetrust

项目描述 :
Free proxy servers list
高级语言: JavaScript
项目地址: git://github.com/indatawetrust/proxy-sources.git
创建时间: 2018-09-15T12:10:01Z
项目社区:https://github.com/indatawetrust/proxy-sources

开源协议:

下载


Travis Build
Status

proxy list resource: https://github.com/clarketm/proxy-list

proxy-list

Free proxy servers list

install

  1. npm i -S proxy-sources

usage

  1. const ProxyList = require('proxy-sources')
  2. const rp = require('request-promise')
  3. ;(async () => {
  4. const pl = await ProxyList();
  5. console.log(pl.list)
  6. /*
  7. [ '125.141.200.14:80',
  8. '125.141.200.36:80',
  9. '125.141.200.15:80',
  10. '125.141.200.7:80',
  11. '125.141.200.38:80',
  12. '191.252.185.161:8090',
  13. '5.196.224.39:8080',
  14. '5.135.164.72:3128' ]
  15. */
  16. // request usage
  17. const options = {
  18. uri: 'https://api.myip.com',
  19. proxy: `http://${pl.random()}`,
  20. json: true
  21. }
  22. console.log(await rp(options))
  23. // sample
  24. // {"ip":"212.93.119.116","country":"Latvia","cc":"LV"}
  25. })()

checker and timeout

Checker is off by default. It allows controlling the proxy addresses. Returns proxy addresses. Timeout is 5 seconds by default. You can set it to 1 second to get fast proxy addresses. Set the timeout value in milliseconds.

  1. const ProxyList = require('proxy-sources')
  2. const rp = require('request-promise')
  3. ;(async () => {
  4. const pl = await ProxyList({
  5. checker: true,
  6. timeout: 1e3
  7. });
  8. })()