mrethical / http-proxies
Use http proxies within your Laravel application
v1.3.1
2023-04-24 14:12 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.0.1
- illuminate/contracts: ^10.0|^9.0|^8.0
- spatie/laravel-package-tools: ^1.12.1
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.0|^6.0|^5.0
- nunomaduro/larastan: ^2.0.1|^1.0.4
- orchestra/testbench: ^8.0|^7.0|^6.23
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- php-webdriver/webdriver: ^1.14
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
Suggests
- php-webdriver/webdriver: Required to used proxy ready webdrivers
This package is auto-updated.
Last update: 2024-11-09 14:01:34 UTC
README
This package help you set up a simple ip proxies management. It can also give you a GuzzleClient with a fresh active proxy configured.
Installation
You can install the package via composer:
composer require mrethical/http-proxies
You can publish and run the migrations with:
php artisan vendor:publish --tag="http-proxies-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="http-proxies-config"
This is the contents of the published config file:
return [ 'model' => Mrethical\HttpProxies\Models\Proxy::class, 'selenium' => [ 'url' => env('SELENIUM_URL', 'http://localhost:4444'), 'timeouts' => [ 'connection' => env('SELENIUM_CONNECTION_TIMEOUT'), 'request' => env('SELENIUM_REQUEST_TIMEOUT'), 'pageload' => env('SELENIUM_PAGELOAD_TIMEOUT', 60), 'script' => env('SELENIUM_SCRIPT_TIMEOUT', 3), ], ], ];
Usage
Add a proxy by calling the http-proxies:add
command
php artisan http-proxies:add 1.2.3.4 --port=80
On your code, get a GuzzleClient with a fresh active proxy.
use Mrethical\HttpProxies\HttpProxies; $client = app(HttpProxies::class)->createClient();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.