Checks Proxy (type - http, socks4, socks5 )
-
Include ProxyCheck Class.
-
Create its object with parameters :
$config = [ 'timeout' => 100, 'check' => ['get', 'post', 'cookie', 'referer', 'user_agent'], ]; $proxyCheckObject = new ProxyCheck($url, $config);
a. $url : is a variable for url you would like to ping.
b. $config : is an optional array for the configuring the
timeout
andcheck
. -
Call the checkProxies function with the array of proxies in the format
$proxies = [ 'XXX.XXX.XXX.XXX:XXXX,username:password,Socks4', 'XXX.XXX.XXX.XXX:XXXX,username:password,Socks5', 'XXX.XXX.XXX.XXX:XXXX' ]; $result = $proxyCheckObject->checkProxies($proxies); echo "<pre>"; print_r($result); echo "</pre>";