DevCraft Документации
РазработкиAPI WrappersWebShare Proxy PHP WrapperEnglish

Proxies v1.0.0

Proxy list, iterate, download, refresh, replacements, connection strings.

Work with the proxy list via App::Requests('Proxy'), QueryBuilder filters, page iteration, and connection strings (backbone / direct).

Quick start

<?php

require_once 'vendor/autoload.php';

use Devcraft\Webshare\Classes\App;
use Devcraft\Webshare\Enums\FilterOperator;

App::init();

/** @var \Devcraft\Webshare\Requests\ProxyRequest $proxies */
$proxies = App::Requests('Proxy');
$proxies->query()
    ->withFilter('mode', 'direct')
    ->withPageSize(25)
    ->withFilter('country_code', ['US', 'DE'], FilterOperator::IN);

$list = $proxies->getList();

foreach ($proxies->iterate() as $proxy) {
    echo $proxy->getConnectionString(backbone: true), "\n";
}
$proxies->query()
    ->withFilter('country_code', ['US', 'DE'], FilterOperator::IN)
    ->withFilter('created_at', '2024-01-01', FilterOperator::GT)
    ->withOrderBy('-created_at', 'country_code')
    ->withSearch('residential');
OperatorAPI syntax
EQUAL?field=value
IN?field__in=a,b
GT / LT?field__gt= / __lt=
CONTAINS?field__contains=

Pagination

Manual pages via withPage / withStartingAfter, or iterate() / PageIterator::items() (default max pages from ITERATE_MAX_PAGES, default 100).

Download and refresh

$token = App::Requests('DownloadToken')->get('proxy_list')->token;
$body = App::Requests('Proxy')->downloadList($token);
App::Requests('Proxy')->refresh();

Paths containing /download/ are never cached.

Connection strings

Not a REST resource — use Proxy::getConnectionString():

foreach ($proxies->iterate() as $proxy) {
    echo $proxy->getConnectionString(backbone: true), "\n";
}

Replacements

  • App::Requests('ProxyReplacement') — list / retrieve / create (v3)
  • App::Requests('ReplacedProxy') — list / download

На этой странице