sahusoftcom/proxy-checker
| Install | |
|---|---|
composer require sahusoftcom/proxy-checker |
|
| Latest Version: | v0.4 |
| PHP: | >=5.5.9 |
| Laravel: | 5 |
| Last Updated: | Mar 25, 2017 |
| Links: | GitHub · Packagist |
Proxy Checker Laravel Version: 0.2
Service Provider for Proxy Checking (type - http, socks4, socks5) that returns all the necessary information related to each proxy(s) for Laravel PHP Framework [ Packagist ]
Installation
Type the following command in your project directory
composer require sahusoftcom/proxy-checker
OR
Add the following line to the require section of composer.json:
{
"require": {
"sahusoftcom/proxy-checker": "dev-master"
}
}
Setup
In /config/app.php, add the following to providers:
SahusoftCom\ProxyChecker\ProxyCheckerServiceProvider::class
How to use
-
You should use the class
SahusoftCom\ProxyChecker\ProxyCheckerService -
Pass
$url&$configparameter inProxyCheckerServiceclass/* * $config [optional] */ $config = [ 'timeout' => 100, 'check' => ['get', 'post', 'cookie', 'referer', 'user_agent'], ]; /* * $url [required1] */ $url = "https://www.google.com"; $proxies = [ 'XXX.XXX.XXX.XXX:XXXX,username:password,Socks4', 'XXX.XXX.XXX.XXX:XXXX,username:password,Socks5', 'XXX.XXX.XXX.XXX:XXXX' ]; $proxyCheckObject = new ProxyCheckerService($url, $config); $result = $proxyCheckObject->checkProxies($proxies); echo "<pre>"; print_r($result); echo "</pre>";
Sample Output
Array
(
[XXX.XXX.XXX.XXX:XXXX,username:password] => Array
(
[allowed] => Array
(
)
[disallowed] => Array
(
[0] => get
[1] => post
[2] => cookie
[3] => referer
[4] => user_agent
)
[proxy_level] =>
[info] => Array
(
[url] => https://www.google.com/
[content_type] => text/html; charset=UTF-8
[http_code] => 200
[header_size] => 1070
[request_size] => 418
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 2.055918
[namelookup_time] => 0.007662
[connect_time] => 0.313878
[pretransfer_time] => 1.490388
[size_upload] => 0
[size_download] => 11431
[speed_download] => 5560
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 1.758965
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => XXX.XXX.XXX.XXX
[certinfo] => Array
(
)
[primary_port] => 8080
[local_ip] => XXX.XXX.X.XXX
[local_port] => XXXXX
)
)
)
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.4 | >=5.5.9 | ^5.1 | ||
| v0.3 | >=5.5.9 | ^5.1 | ||
| v0.2 | >=5.5.9 | ^5.1 | ||
| v0.1 | >=5.5.9 | ^5.1 |