Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PHP Guzzle Proxy Example — Residential & ISP Proxies

Using Guzzle behind an authenticated proxy in PHP: per-client and per-request configuration, ISP targeting, and cURL fallbacks.

Per-client (every request proxied)

use GuzzleHttp\Client;

$user = getenv('QP_USER') . '-country-us';
$pass = getenv('QP_PASS');

$client = new Client([
    'proxy'   => "http://$user:$pass@residentialboson.quantumproxies.io:9000",
    'timeout' => 30,
]);

$res = $client->get('https://ipinfo.io/json');
echo $res->getBody();

Per-request (mix proxied and direct calls)

$client = new Client(['timeout' => 30]);

$res = $client->get('https://ipinfo.io/json', [
    'proxy' => "http://$user:$pass@residentialboson.quantumproxies.io:9000",
]);

ISP-targeted exits

Static ISP proxies sit between datacenter (fast, easily flagged) and residential (stealthy, rotating): real carrier ASNs with server-grade uptime. The premium gateway takes an -isp- flag:

$isp = "http://{$user}-country-us-region-california-city-losangeles-isp-comcast:$pass"
     . "@residentialpremium.quantumproxies.io:8080";

Plain cURL (no Composer)

$ch = curl_init('https://ipinfo.io/json');
curl_setopt_array($ch, [
    CURLOPT_PROXY          => 'residentialboson.quantumproxies.io:9000',
    CURLOPT_PROXYUSERPWD   => "$user:$pass",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
]);
echo curl_exec($ch);

Full runnable script in example.php:

composer require guzzlehttp/guzzle
QP_USER=... QP_PASS=... php example.php

Proxies by QuantumProxies — ISP, residential, datacenter and mobile pools with per-GB pricing. Account + credentials: app.quantumproxies.io.

About

PHP Guzzle behind residential & ISP proxies: per-client, per-request and plain-cURL setups.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages