juzaweb / proxies
Craw and management proxies
- dev-master
- v1.x-dev
- 1.0.1
- 1.0.0
- dev-feature/proxy-management-tests-15832548336964798510
- dev-refactor-proxy-user-agent-1704493628928089241
- dev-refactor-proxymanager-di-10716835228986177715
- dev-code-health-test-proxy-command-5824165229186207599
- dev-feature/proxies-management-1430885190587788272
- dev-fix/proxy-manager-improvements-150618893481585831
- dev-improve-readme-17757700868266608311
- dev-performance-reuse-guzzle-client-2217378913884364882
- dev-fix-insecure-ssl-proxy-client-2356162984977610513
- dev-testing-improvement-proxy-helper-12202839077738095973
- dev-fix-unused-constructor-param-proxy-4589263207061264032
- dev-init-tests-6319218048122512838
This package is auto-updated.
Last update: 2026-02-23 06:25:31 UTC
README
The Juzaweb Proxies Module is a comprehensive solution for managing, crawling, and testing proxies within your Juzaweb CMS application. It provides tools to maintain a pool of active proxies, verify their connectivity, and seamlessly integrate them into your application logic.
Features
- Proxy Management: Store and manage proxy details including IP, port, protocol, and authentication credentials.
- Automated Testing: Schedule regular checks to ensure proxies are active and responsive.
- On-Demand Testing: Manually test specific proxies via Artisan commands.
- Proxy Allocation: Retrieve available ("free") proxies for use in your application, with concurrency handling.
- Admin Interface: Configure settings and view proxy status directly from the Juzaweb Admin Panel.
Installation
You can install the package via composer:
composer require juzaweb/proxies
Configuration
Database Settings
The module uses the following settings keys which can be configured via the Juzaweb Admin Panel (Settings -> Proxies) or directly in the database:
proxy_test_url: The URL used to verify proxy connectivity (Default:https://translate.google.com).proxy_test_timeout: The timeout duration in seconds for proxy connection tests (Default:20).proxy_auto_test_enable: Enable automatic hourly testing of proxies (Set to1to enable).
Scheduler
To enable the automatic proxy checker, ensure your application's scheduler is running. If proxy_auto_test_enable is set to 1, the module will register a scheduled command to check proxies hourly.
php artisan schedule:run
Usage
Artisan Commands
The module provides several Artisan commands for managing proxies from the command line.
Check Proxies
Run a check on all available (free) proxies in the database.
php artisan proxy:check
You can also check a specific proxy by providing its address:
php artisan proxy:check --proxy=192.168.1.1:8080
Test Connectivity
Test the connectivity of a specific proxy configuration.
php artisan proxy:test <ip> <port> [protocol]
Example:
php artisan proxy:test 127.0.0.1 8080 https
Programmatic Usage
You can use the Juzaweb\Modules\Proxies\Contracts\ProxyManager contract to interact with proxies in your code.
Retrieve a Random Active Proxy
To get a random proxy that is currently active:
use Juzaweb\Modules\Proxies\Contracts\ProxyManager; $proxyManager = app(ProxyManager::class); $proxy = $proxyManager->random(); if ($proxy) { // Use the proxy echo $proxy->ip . ':' . $proxy->port; }
Retrieve and Reserve an Available Proxy
To get an available ("free") proxy and mark it as in-use (setting is_free to false):
use Juzaweb\Modules\Proxies\Contracts\ProxyManager; $proxyManager = app(ProxyManager::class); $proxy = $proxyManager->free(); if ($proxy) { // The proxy is now marked as not free. // Use the proxy... }
Helper Functions
The module provides global helper functions for working with proxy strings:
is_proxy_format(string $proxy): bool- Validates if a string is in the formatIP:PORT.parse_proxy_string_to_array(string $proxy): array- Parses a proxy string into an array with keysip,port,protocol,created_at, andupdated_at.
License
This project is licensed under the GPL-2.0 License.