Guzzle

Guzzle

A PHP HTTP client for sending requests through proxies with simple configuration.

Guzzle

Guzzle is the most popular PHP HTTP client library. It provides a simple interface for sending HTTP requests and supports proxy configuration for routing traffic through HypeProxy.io.

Setting Up HypeProxy.io with Guzzle

Basic Proxy Configuration

use GuzzleHttp\Client;

$client = new Client([
    'proxy' => 'http://username:password@fr.hypeproxy.host:port'
]);

$response = $client->get('https://api.ipify.org?format=json');
echo $response->getBody();

SOCKS5 Proxy

$client = new Client([
    'proxy' => 'socks5://username:password@fr.hypeproxy.host:port'
]);

Per-Request Proxy

$client = new Client();

$response = $client->get('https://example.com', [
    'proxy' => 'http://username:password@fr.hypeproxy.host:port'
]);

Tips

  • Use a base client with proxy config for reusable proxy settings across requests.
  • Guzzle supports both HTTP and SOCKS5 proxies from HypeProxy.io.
  • Add 'timeout' => 30 to avoid hanging requests.
  • Use 'verify' => false only for debugging — keep SSL verification enabled in production.

Was this article helpful?