PHP
Languages & HTTP Clients
PHP (Guzzle) proxy integration
Guzzle is the standard PHP HTTP client and accepts a proxy per request or per client. Pass your Aethyn endpoint in the proxy option and every request tunnels through a residential IP.
Setup steps
- 1Install Guzzle: composer require guzzlehttp/guzzle.
- 2Create a client (or per-request options) with the proxy option.
- 3Use the full http://user:pass@host:port form.
- 4Add targeting suffixes to the username as needed.
Code
Guzzle client with proxy
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'proxy' => 'http://aethyn-XXXXX-country-us:PASSWORD@proxy.aethyn.io:2099',
'timeout' => 30,
]);
$res = $client->get('https://httpbin.org/ip');
echo $res->getBody();Replace aethyn-XXXXX and PASSWORD with your dashboard credentials. See the full targeting reference and protocol/port list.
Tips
- Set a timeout — residential routes are slower than datacenter.
- Reuse one client instance across requests.
- For cURL extension users, the CURLOPT_PROXY option works the same way.
PHP (Guzzle) proxy FAQ
Can I set the proxy per request in Guzzle?
Yes. Pass the proxy option in the per-request options array instead of the client constructor to use different exits per call.
Docs, solutions & blog
Premium residential proxiesCost-efficient rotating residential pool from €2.00/GB for bulk scraping and monitoring.Elite residential proxiesCurated high-trust pool with city and ISP targeting for hard anti-bot targets.Quickstart docsCredentials, endpoints, and your first proxied request.Proxy glossaryPlain-English definitions for residential proxies, rotation, anti-bot, and scraping terms.