1.0.4 • Published 4 years ago

proxy-sources v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Travis Build
Status

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

proxy-list

Free proxy servers list

install

npm i -S proxy-sources

usage

const ProxyList = require('proxy-sources')
const rp = require('request-promise')

;(async () => {

  const pl = await ProxyList();

  console.log(pl.list)

  /*
  [ '125.141.200.14:80',
  '125.141.200.36:80',
  '125.141.200.15:80',
  '125.141.200.7:80',
  '125.141.200.38:80',
  '191.252.185.161:8090',
  '5.196.224.39:8080',
  '5.135.164.72:3128' ]
  */

  // request usage
  const options = {
    uri: 'https://api.myip.com',
    proxy: `http://${pl.random()}`,
    json: true
  }

  console.log(await rp(options))

  // sample
  // {"ip":"212.93.119.116","country":"Latvia","cc":"LV"}

})()

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.

const ProxyList = require('proxy-sources')
const rp = require('request-promise')

;(async () => {

  const pl = await ProxyList({
    checker: true,
    timeout: 1e3
  });
})()
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago