How to use the proxy-lists.getProxies function in proxy-lists

To help you get started, we’ve selected a few proxy-lists examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fa7ad / spotprox / app.js View on Github external
const fs = require('fs')
const opn = require('opn')
const path = require('path')
const $ = require('shelljs')
const _sample = require('lodash/sample')
const proxyFetcher = require('proxy-lists')

const proxyOptions = {
  countries: ['us'],
  protocols: ['http'],
  ipTypes: ['ipv4'],
  sourcesBlackList: ['bitproxies', 'kingproxies']
}
let proxList = []

const fetchProxy = proxyFetcher.getProxies(proxyOptions)

console.log('Downloading proxy list...')
fetchProxy.on('data', function (proxies) {
  if (proxList.length > 50) return this.emit('end')
  proxList.push(...proxies.map(p => `${p.ipAddress}:${p.port}`))
  process.stdout.write('*')
})

fetchProxy.on('error', function () {
  process.stdout.write('x')
  if (proxList.length > 50) this.emit('end')
})

fetchProxy.once('end', function () {
  console.log('DONE!')
  let config

proxy-lists

Get proxies from publicly available proxy lists.

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis