Proxy in Guzzle with one option
In Guzzle a proxy is the proxy option with a string that already holds the login and password. Here is a client that prints the IP.

Why use a proxy in Guzzle
Guzzle is a PHP HTTP client installed via Composer. The proxy is passed in the proxy request option: a string, or an array with http, https and no keys. With the cURL handler the http, https, socks4, socks4a, socks5 and socks5h schemes are supported.
Take HTTP unless you have a reason not to. For SOCKS5 use the socks5h scheme so DNS goes through the proxy. Rotation for data collection, a sticky session for an API that remembers the client by IP.
Residential
from $0.6 / GBHome ISP addresses. The main choice for accounts and protected sites.
VIP
$2 / GBHand-picked clean IPs, faster and more stable than regular residential.
Mobile
$4 / GBCarrier IPs, for platforms that check addresses strictly.
Step-by-step setup
Button names are given exactly as they appear in Guzzle.
Install Guzzle
In the project folder run composer require guzzlehttp/guzzle. You need the php-curl extension; it enables SOCKS.
Build the string
Export login:pass@ip:port in @SousProxyBot and prepend http:// or socks5h://.
Pass proxy
Set 'proxy' in the Client constructor so it applies to all requests. You can also pass it to an individual $client->get().
Run it
Save the example as ip.php next to vendor and run php ip.php.
Check the IP
The script prints JSON with the proxy address.
Code example
Put in your own HOST, PORT, LOGIN and PASSWORD from the bot or the dashboard.
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
// SOCKS5: 'socks5h://LOGIN:PASSWORD@HOST:PORT'
'proxy' => 'http://LOGIN:PASSWORD@HOST:PORT',
'timeout' => 15,
]);
$response = $client->get('https://api.ipify.org?format=json');
echo $response->getBody() . PHP_EOL;
Tested by running it
We ran this example ourselves: PHP 8.3.6 · guzzlehttp/guzzle 8.5.5. Real output below, IP hidden.
$ php ip.php {"ip":"proxy IP"}
And this is the response when the password is wrong:
$ php ip.php
…
...
#15 /home/user/proxy-test/ip.php(12): GuzzleHttp\Client->get()
#16 {main}
thrown in /home/user/proxy-test/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 1457Check that it works
Open these pages through Guzzle with the proxy on.
Common errors
The issues people most often bring to support.
ConnectException or 407 from the proxyCheck the login and password. Encode special characters in the password with rawurlencode.
The "socks5" proxy scheme is not supportedSOCKS works only with the cURL handler. Install php-curl; without it Guzzle uses the stream handler.
Some addresses should go directPass proxy as an array: ['http' => ..., 'https' => ..., 'no' => ['localhost', '.internal']].
cURL error 28: Operation timed outA slow IP or a wrong port. Test the line on /en/tools/proxy-checker/ and raise the timeout.
FAQ
Proxy per client or per request?
Both work. The option on a specific request overrides the Client constructor value.
How do I set different proxies for http and https?
Pass an array: 'proxy' => ['http' => 'http://...', 'https' => 'http://...']. The key is the site's scheme.
How do I change the IP between requests?
Choose rotation when exporting. Nothing to change in the code.
