This package allows you to use a proxy transparently in guzzle.

0.0.2 2019-01-17 11:17 UTC

This package is auto-updated.

Last update: 2022-09-10 14:39:33 UTC


Latest Version Software License Build Status Coverage Status Quality Score Total Downloads Average time to resolve an issue Percentage of issues still open

This package provides middleware for guzzle for handling proxy connection using one of the following proxy services:


To install, use composer:

composer require softonic/guzzle-proxy-middleware


To use this middleware, you need to initialize it like:

For Proxy Bonanza:

$proxyManager = new ProxyManager(
    new ProxyBonanza(
        new GuzzleClient(),
        $cache, // A PSR-6 item pool cache.

For SSL Private Proxy:

$proxyManager = new ProxyManager(
    new SslPrivateProxy(
        new GuzzleClient(),
        $cache, // A PSR-6 item pool cache.

And inject it to Guzzle with something like:

$stack = new HandlerStack();
$stack->setHandler(new CurlHandler());
$guzzleClient = new GuzzleClient(['handler' => $stack]);

From now on every request sent with $guzzleClient will be done using a random proxy from your proxy list.


softonic/guzzle-proxy-middleware has a PHPUnit test suite and a coding style compliance test suite using PHP CS Fixer.

To run the tests, run the following command from the project folder.

$ docker-compose run test

To run interactively using PsySH:

$ docker-compose run psysh


The Apache 2.0 license. Please see LICENSE for more information.