PHPackages                             supr3m/proxy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. supr3m/proxy

ActiveLibrary[HTTP &amp; Networking](/categories/http)

supr3m/proxy
============

Proxy library that forwards requests to the desired url and returns the response.

v2.2.1(11y ago)0128MITPHP

Since Aug 10Pushed 10y ago1 watchersCompare

[ Source](https://github.com/supr3m/php-proxy)[ Packagist](https://packagist.org/packages/supr3m/proxy)[ Docs](https://github.com/jenssegers/php-proxy)[ RSS](/packages/supr3m-proxy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (10)Used By (0)

PHP Proxy
=========

[](#php-proxy)

[![Build Status](https://camo.githubusercontent.com/40c802aa1b16d121cd23a0b30c7e510546e01e8d6d289f260f01bd6a5a8d70e3/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6a656e737365676572732f7068702d70726f78792e737667)](https://travis-ci.org/jenssegers/php-proxy) [![Coverage Status](https://camo.githubusercontent.com/1d330a96cf6f90714fac80caa82f2e3e4f7292f3a097f6d90b97b29e283f6bd8/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a656e737365676572732f7068702d70726f78792e737667)](https://coveralls.io/r/jenssegers/php-proxy?branch=master)

This is a HTTP/HTTPS proxy script that forwards requests to a different server and returns the response. The Proxy class uses PSR7 request/response objects as input/output, and uses Guzzle to do the actual HTTP request.

Installation
------------

[](#installation)

Install using composer:

```
composer require jenssegers/proxy

```

Example
-------

[](#example)

The following example creates a request object, based on the current browser request, and forwards it to `example.com`. The `RemoveEncodingFilter` removes the encoding headers from the original response so that the current webserver can set these correctly.

```
use Proxy\Proxy;
use Proxy\Adapter\Guzzle\GuzzleAdapter;
use Proxy\Filter\RemoveEncodingFilter;
use Zend\Diactoros\ServerRequestFactory;

// Create a PSR7 request based on the current browser request.
$request = ServerRequestFactory::fromGlobals();

// Create a guzzle client
$guzzle = new GuzzleHttp\Client();

// Create the proxy instance
$proxy = new Proxy(new GuzzleAdapter($guzzle));

// Add a response filter that removes the encoding headers.
$proxy->filter(new RemoveEncodingFilter());

// Forward the request and get the response.
$response = $proxy->forward($request)->to('http://example.com');

// Output response to the browser.
(new Zend\Diactoros\Response\SapiEmitter)->emit($response);
```

Filters
-------

[](#filters)

You can apply filters to the requests and responses using the middleware strategy:

```
$response = $proxy
	->forward($request)
	->filter(function ($request, $response, $next) {
		// Manipulate the request object.
		$request = $request->withHeader('User-Agent', 'FishBot/1.0');

		// Call the next item in the middleware.
		$response = $next($request, $response);

		// Manipulate the response object.
		$response = $response->withHeader('X-Proxy-Foo', 'Bar');

		return $response;
	})
	->to('http://example.com');
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 90.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~104 days

Total

7

Last Release

3897d ago

Major Versions

v2.2.1 → v3.0.0-beta2015-10-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6155544?v=4)[César Fernando González Reyes](/maintainers/supr3m)[@supr3m](https://github.com/supr3m)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (64 commits)")[![developarts](https://avatars.githubusercontent.com/u/3060193?v=4)](https://github.com/developarts "developarts (2 commits)")[![fabrizim](https://avatars.githubusercontent.com/u/79165?v=4)](https://github.com/fabrizim "fabrizim (1 commits)")[![alexandrusavin](https://avatars.githubusercontent.com/u/1612455?v=4)](https://github.com/alexandrusavin "alexandrusavin (1 commits)")[![jsor](https://avatars.githubusercontent.com/u/55574?v=4)](https://github.com/jsor "jsor (1 commits)")[![mcg-web](https://avatars.githubusercontent.com/u/1496283?v=4)](https://github.com/mcg-web "mcg-web (1 commits)")[![Remo](https://avatars.githubusercontent.com/u/129864?v=4)](https://github.com/Remo "Remo (1 commits)")

---

Tags

proxy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/supr3m-proxy/health.svg)

```
[![Health](https://phpackages.com/badges/supr3m-proxy/health.svg)](https://phpackages.com/packages/supr3m-proxy)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.8k](/packages/laravel-framework)[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.6k](/packages/symfony-http-kernel)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M966](/packages/statamic-cms)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M334](/packages/api-platform-core)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
