Download the PHP package retrowaver/proxy-checker without Composer
On this page you can find all versions of the php package retrowaver/proxy-checker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download retrowaver/proxy-checker
More information about retrowaver/proxy-checker
Files in retrowaver/proxy-checker
Package proxy-checker
Short Description Proxy Checker is a PHP library that allows you to quickly check a list of proxies.
License MIT
Informations about the package proxy-checker
PHP Proxy Checker
Proxy Checker is a PHP library that allows you to quickly check a list of proxies.
- fast (thanks to asynchronous requests)
- simple (PSR-7 based)
- supports many protocols
- customizable (full control over request / response checking)
Installation
How it works?
ProxyChecker
constructor takes 2 mandatory arguments:
- PSR-7 Request
- object that implements
ResponseCheckerInterface
When checkProxies()
is called, it attempts to send that request using every proxy, and then calls checkResponse()
of provided ResponseCheckerInterface
implementation, which ultimately decides whether proxy is valid or not.
Depending on how much control you want, you can use built-in ResponseCheckerBuilder
for a quick start (see below) or make a custom class.
1. Basic usage
Step 1. Make proxy array
Make proxy array manually:
... or use built-in simple importer:
Step 2. Prepare a request
Prepare a PSR-7 request that will be send using proxies.
Step 3. Prepare ResponseChecker
You can use built-in ResponseCheckerBuilder:
or write a custom ResponseCheckerInterface
implementation:
Step 4. Create ProxyChecker and check proxies
2. Additional info
Options reference
ProxyChecker
accepts optional parameters $options
and $requestOptions
:
$options
concurrency
- max concurrent request (default 50)
$requestOptions
are Guzzle request options that are passed to Guzzle client while sending a request. Currently there's only one default value:'timeout' => 20
Supported protocols
PHP Proxy Checker should work with http, https, socks4, socks4a, socks5 and socks5h proxies (see https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html for descriptions).