https://github.com/mrethical/http-proxies
Use http proxies within your Laravel application
https://github.com/mrethical/http-proxies
client guzzlehttp http laravel proxy
Last synced: 3 months ago
JSON representation
Use http proxies within your Laravel application
- Host: GitHub
- URL: https://github.com/mrethical/http-proxies
- Owner: mrethical
- License: mit
- Created: 2022-09-30T03:56:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T11:50:20.000Z (over 2 years ago)
- Last Synced: 2025-07-19T14:04:10.493Z (9 months ago)
- Topics: client, guzzlehttp, http, laravel, proxy
- Language: PHP
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Use http proxies within your Laravel application
[](https://packagist.org/packages/mrethical/http-proxies)
[](https://github.com/mrethical/http-proxies/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/mrethical/http-proxies/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/mrethical/http-proxies)
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:
```bash
composer require mrethical/http-proxies
```
You can publish and run the migrations with:
```bash
php artisan vendor:publish --tag="http-proxies-migrations"
php artisan migrate
```
You can publish the config file with:
```bash
php artisan vendor:publish --tag="http-proxies-config"
```
This is the contents of the published config file:
```php
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
```bash
php artisan http-proxies:add 1.2.3.4 --port=80
```
On your code, get a GuzzleClient with a fresh active proxy.
```php
use Mrethical\HttpProxies\HttpProxies;
$client = app(HttpProxies::class)->createClient();
```
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Credits
- [Jefferson Magboo](https://github.com/mrethical)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.