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

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

diepxuan/php-proxy
==================

02PHP

Since Jun 26Pushed 3y agoCompare

[ Source](https://github.com/diepxuan/php-proxy)[ Packagist](https://packagist.org/packages/diepxuan/php-proxy)[ RSS](/packages/diepxuan-php-proxy/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://camo.githubusercontent.com/875c42d85cd4903cb35668fb2c0a8b5ffc41af4049e0799f2ec3b51e4fc25e10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f646965707875616e2f7068702d70726f7879)](https://camo.githubusercontent.com/875c42d85cd4903cb35668fb2c0a8b5ffc41af4049e0799f2ec3b51e4fc25e10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f646965707875616e2f7068702d70726f7879) [![](https://camo.githubusercontent.com/6cd1becd34322e72add4cb85c2af25b7ab5ef0404b04640ad11d643c0b54a510/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f646965707875616e2f7068702d70726f7879)](https://camo.githubusercontent.com/6cd1becd34322e72add4cb85c2af25b7ab5ef0404b04640ad11d643c0b54a510/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f646965707875616e2f7068702d70726f7879)

php-proxy
=========

[](#php-proxy)

Proxy script built on PHP, Symfony and cURL. This library borrows ideas from Glype, Jenssegers proxy, and Guzzle.

PHP-Proxy Web Application
-------------------------

[](#php-proxy-web-application)

If you're looking for a **project** version of this script that functions as a Web Application similar to Glype, then visit [**php-proxy-app**](https://github.com/diepxuan/php-proxy-app)

See this php-proxy in action: [proxy.unblockvideos.com](https://proxy.unblockvideos.com/)

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

[](#installation)

Install it using [Composer](http://getcomposer.org):

```
composer require diepxuan/php-proxy
```

Example
-------

[](#example)

```
require('vendor/autoload.php');

use Proxy\Http\Request;
use Proxy\Proxy;

$request = Request::createFromGlobals();

$proxy = new Proxy();

$proxy->getEventDispatcher()->addListener('request.before_send', function($event){

	$event['request']->headers->set('X-Forwarded-For', 'php-proxy');

});

$proxy->getEventDispatcher()->addListener('request.sent', function($event){

	if($event['response']->getStatusCode() != 200){
		die("Bad status code!");
	}

});

$proxy->getEventDispatcher()->addListener('request.complete', function($event){

	$content = $event['response']->getContent();
	$content .= '';

	$event['response']->setContent($content);

});

$response = $proxy->forward($request, "http://www.yahoo.com");

// send the response back to the client
$response->send();
```

Plugin Example
--------------

[](#plugin-example)

```
namespace Proxy\Plugin;

use Proxy\Plugin\AbstractPlugin;
use Proxy\Event\ProxyEvent;

use Proxy\Html;

class MultiSiteMatchPlugin extends AbstractPlugin {

	// Matches multiple domain names (abc.com, abc.de, abc.pl) using regex (you MUST use / character)
	protected $url_pattern = '/^abc\.(com|de|pl)$/is';
	// Matches a single domain name
	//protected $url_pattern = 'abc.com';

	public function onCompleted(ProxyEvent $event){

		$response = $event['response'];

		$html = $response->getContent();

		// do your stuff here...

		$response->setContent($html);
	}
}
```

Notice that you must use the **/** character for regexes on `$url_pattern`

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.6% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/90fcb59bfa8097c0e0dacd05f43901adb774dc4adb6172b2b743635f8f3d1d2e?d=identicon)[caothu159](/maintainers/caothu159)

---

Top Contributors

[![Athlon1600](https://avatars.githubusercontent.com/u/1063088?v=4)](https://github.com/Athlon1600 "Athlon1600 (163 commits)")[![webaddicto](https://avatars.githubusercontent.com/u/8770136?v=4)](https://github.com/webaddicto "webaddicto (8 commits)")[![diffen](https://avatars.githubusercontent.com/u/884719?v=4)](https://github.com/diffen "diffen (3 commits)")[![caothu159](https://avatars.githubusercontent.com/u/4988663?v=4)](https://github.com/caothu159 "caothu159 (2 commits)")[![Eliastik](https://avatars.githubusercontent.com/u/26941242?v=4)](https://github.com/Eliastik "Eliastik (2 commits)")[![achasseux](https://avatars.githubusercontent.com/u/3685300?v=4)](https://github.com/achasseux "achasseux (1 commits)")[![khavishbhundoo](https://avatars.githubusercontent.com/u/18513761?v=4)](https://github.com/khavishbhundoo "khavishbhundoo (1 commits)")[![miicha](https://avatars.githubusercontent.com/u/3731697?v=4)](https://github.com/miicha "miicha (1 commits)")[![arabcoders](https://avatars.githubusercontent.com/u/1621552?v=4)](https://github.com/arabcoders "arabcoders (1 commits)")

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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