Service for Proxy Checking that returns all the necessary information related to each proxy(s)
Type the following command in your project directory
composer require arhx/proxy-checker
- You should use the class
Arhx\ProxyChecker\ProxyChecker - Pass
$url&$configparameter inProxyCheckerclass
/*
* $check_page [required]
* $config [optional]
*/
$check_page = 'http://myproxychecker.com/check.php';
$config = [
'timeout' => 100,
'check' => ['get', 'post', 'cookie', 'referer', 'user_agent'],
];
$checker = new ProxyChecker($check_page, $config);
/*
* $proxy [required]
* &$error_message [optional]
*
*/
$proxy = 'protocol://username:password@hostname:port';
$result = $checker->checkProxy($proxy, $error_message);
if($result){
print_r($result);
}else{
echo "Error: $error_message\n";
}Array
(
[allowed] => Array
(
[0] => get
[1] => post
[2] => cookie
[3] => referer
[4] => user_agent
)
[disallowed] => Array
(
)
[proxy_level] => elite
)
<?php
// possible url for this file: http://myproxychecker.com/check.php
include 'vendor/autoload.php';
$checkResult = \Arhx\ProxyChecker\ProxyChecker::checkPage();
$checkResult = implode(PHP_EOL,$checkResult);
echo $checkResult;