PHPackages                             itsmill3rtime/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. itsmill3rtime/proxy

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

itsmill3rtime/proxy
===================

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

v3.1.1(3y ago)06PHPPHP \*

Since Aug 10Pushed 3y agoCompare

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

READMEChangelog (2)Dependencies (8)Versions (14)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 Laminas\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());

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

    // Output response to the browser.
    (new Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($response);
} catch(\GuzzleHttp\Exception\BadResponseException $e) {
    // Correct way to handle bad responses
    (new Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($e->getResponse());
}
```

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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 74.8% 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 ~263 days

Recently: every ~383 days

Total

12

Last Release

1395d ago

Major Versions

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

PHP version history (2 changes)v3.0.1PHP ^5.6 || ^7.0

v3.1.1PHP \*

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2539808?v=4)[Jimmy](/maintainers/itsmill3rtime)[@itsmill3rtime](https://github.com/itsmill3rtime)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (83 commits)")[![jmolivas](https://avatars.githubusercontent.com/u/366275?v=4)](https://github.com/jmolivas "jmolivas (8 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (4 commits)")[![jmortlock](https://avatars.githubusercontent.com/u/10041761?v=4)](https://github.com/jmortlock "jmortlock (3 commits)")[![abm-devmonk-purple](https://avatars.githubusercontent.com/u/18488288?v=4)](https://github.com/abm-devmonk-purple "abm-devmonk-purple (3 commits)")[![developarts](https://avatars.githubusercontent.com/u/3060193?v=4)](https://github.com/developarts "developarts (2 commits)")[![Remo](https://avatars.githubusercontent.com/u/129864?v=4)](https://github.com/Remo "Remo (1 commits)")[![ab-kily](https://avatars.githubusercontent.com/u/9202344?v=4)](https://github.com/ab-kily "ab-kily (1 commits)")[![vundb](https://avatars.githubusercontent.com/u/3923907?v=4)](https://github.com/vundb "vundb (1 commits)")[![alexandrusavin](https://avatars.githubusercontent.com/u/1612455?v=4)](https://github.com/alexandrusavin "alexandrusavin (1 commits)")[![fabrizim](https://avatars.githubusercontent.com/u/79165?v=4)](https://github.com/fabrizim "fabrizim (1 commits)")[![itsmill3rtime](https://avatars.githubusercontent.com/u/2539808?v=4)](https://github.com/itsmill3rtime "itsmill3rtime (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)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[jenssegers/proxy

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

940487.2k4](/packages/jenssegers-proxy)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)[laminas/laminas-psr7bridge

Bidirectional conversions between PSR-7 and laminas-http messages

117.9M18](/packages/laminas-laminas-psr7bridge)[mimmi20/browser-detector

Library to detect Browsers and Devices

48153.5k3](/packages/mimmi20-browser-detector)

PHPackages © 2026

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