PHPackages                             endpot/php-rest-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. [API Development](/categories/api)
4. /
5. endpot/php-rest-proxy

ActiveLibrary[API Development](/categories/api)

endpot/php-rest-proxy
=====================

A php rest proxy script based on guzzle

v1.0.1(7y ago)108311MITPHP

Since Oct 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/endpot/php-rest-proxy)[ Packagist](https://packagist.org/packages/endpot/php-rest-proxy)[ RSS](/packages/endpot-php-rest-proxy/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

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

[](#php-rest-proxy)

About
-----

[](#about)

This project is aimed to ultilize a rest proxy with php basing on Guzzle. Up to now, the script works fine for the most common request method (GET/POST/PUT/DELETE/OPTIONS). When data is submitted with POST method and contain multipart/form-data content, the script would create a new MultipartStream with global constant $\_POST and $\_FILES, and then transfer to target uri. The script also supports simple middleware within which you can deal with the request/response.

关于
--

[](#关于)

该项目基于Guzzle实现请求的转发，包括但不限于GET/POST/PUT/DELETE/OPTIONS等方法。当请求方法为POST，且内容类型为multipart/form-data时，由于PHP的特性，从php://input中获取不到原始的数据，脚本会解析POST和FILES数组生成MultipartStream，再进行转发。该脚本还支持简单的中间件，分别作用于请求转发前后，对请求和响应进行处理。

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

[](#installation)

Install using composer:

```
composer require endpot/php-rest-proxy

```

Example
-------

[](#example)

```
// create proxy instance
$proxy = new \Proxy\Proxy();

// set target url
$targetUrl = 'http://httpbin.org/';

// create psr7 request based on the global parameters
$request = $proxy->fromGlobals();

// add middlewares
// forward request to target
$response = $proxy->addMiddleware('ExampleMiddleware')
    ->forward($request)
    ->to($targetUrl);

// get and show the response
echo $response->getBody();
```

License
-------

[](#license)

It is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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 ~373 days

Total

2

Last Release

2753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb29b3a1c6a6e88b7f3e1f3a543060cc429bde562742a5a88419c32ddf0c9b8?d=identicon)[HunterXuan](/maintainers/HunterXuan)

---

Top Contributors

[![HunterXuan](https://avatars.githubusercontent.com/u/4209116?v=4)](https://github.com/HunterXuan "HunterXuan (9 commits)")[![idealogica](https://avatars.githubusercontent.com/u/15087194?v=4)](https://github.com/idealogica "idealogica (1 commits)")

---

Tags

phpproxyrest

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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