2017 © Pedro Peláez
 

library php-rotatingproxymanager

A PHP library you can use to select proxies in a rotation.

image

waylaidwanderer/php-rotatingproxymanager

A PHP library you can use to select proxies in a rotation.

  • Saturday, December 10, 2016
  • by waylaidwanderer
  • Repository
  • 2 Watchers
  • 3 Stars
  • 284 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

PHP-RotatingProxyManager

A PHP library you can use to select proxies in a rotation. It uses SQLite to store proxy data so you can use multiple instances of RotatingProxyManager across multiple scripts and it will still work. Requires the SQLite extension for PHP to be installed., (*1)

Installation

composer require waylaidwanderer/php-rotatingproxymanager, (*2)

Usage

// supports proxies in the format "user:pass@ip:port" or simply "ip:port"

$list = [];
$proxiesFile = './proxies.txt';
$proxies = file($proxiesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($proxies as $proxy) {
    $rotatingProxy = new RotatingProxy($proxy);
    $rotatingProxy->setWaitInterval(2);
    $list[] = $rotatingProxy;
}

$databaseFileLocation = __DIR__;
$proxyManager = new RotatingProxyManager($list, $databaseFileLocation);
$proxyToUse = $proxyManager->getNextProxy();
var_dump($proxyToUse->getUsername());
var_dump($proxyToUse->getPassword());
var_dump($proxyToUse->getIp());
var_dump($proxyToUse->getPort());
var_dump($proxyToUse->toString()); // will output "user:pass@ip:port" or just "ip:port"

The Versions

10/12 2016

dev-master

9999999-dev

A PHP library you can use to select proxies in a rotation.

  Sources   Download

MIT

The Requires

  • ext-pdo_sqlite *

 

The Development Requires

10/12 2016

1.0.3

1.0.3.0

A PHP library you can use to select proxies in a rotation.

  Sources   Download

MIT

The Requires

  • ext-pdo_sqlite *

 

The Development Requires

23/07 2016

1.0.2

1.0.2.0

A PHP library you can use to select proxies in a rotation.

  Sources   Download

MIT

The Requires

  • ext-pdo_sqlite *

 

The Development Requires

12/07 2016

1.0.1

1.0.1.0

A PHP library you can use to select proxies in a rotation.

  Sources   Download

MIT

The Requires

  • ext-sqlite3 *

 

The Development Requires

12/07 2016

1.0.0

1.0.0.0

A PHP library you can use to select proxies in a rotation.

  Sources   Download

MIT

The Requires

  • ext-sqlite3 *

 

The Development Requires