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

ActiveYii2-extension[HTTP &amp; Networking](/categories/http)

asminog/yii2-proxy
==================

HTTP proxy action extension for the Yii framework

v0.1.1(1y ago)032MITPHPPHP &gt;=7.4CI passing

Since Mar 30Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

HTTP Proxy Extension for Yii 2
==============================

[](#http-proxy-extension-for-yii-2)

This is a simple proxy for Yii2 framework. This extension provides the HTTP proxy action for the [Yii framework 2.0](https://www.yiiframework.com).

For license information check the [LICENSE](LICENSE)-file.

[![Build Status](https://github.com/asminog/yii2-proxy/workflows/analyze/badge.svg)](https://github.com/asminog/yii2-proxy/actions/workflows/analyze.yml)[![Build Status](https://github.com/asminog/yii2-proxy/workflows/phpmd/badge.svg)](https://github.com/asminog/yii2-proxy/actions/workflows/phpmd.yml)

[![GitHub repo file count](https://camo.githubusercontent.com/7e66a5583ec4ce0bd52a07ba2844674b6efe384881c7e6d33a67fd86aa0be8d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6469726563746f72792d66696c652d636f756e742f61736d696e6f672f796969322d70726f7879)](https://camo.githubusercontent.com/7e66a5583ec4ce0bd52a07ba2844674b6efe384881c7e6d33a67fd86aa0be8d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6469726563746f72792d66696c652d636f756e742f61736d696e6f672f796969322d70726f7879)[![GitHub code size in bytes](https://camo.githubusercontent.com/ae9863199cccec053c74aab93a3732cc54310aaef2472f9f41fe5344a4da4587/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f61736d696e6f672f796969322d70726f7879)](https://camo.githubusercontent.com/ae9863199cccec053c74aab93a3732cc54310aaef2472f9f41fe5344a4da4587/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f61736d696e6f672f796969322d70726f7879)

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

[](#installation)

```
composer require asminog/yii2-proxy
```

Usage on domain.com
-------------------

[](#usage-on-domaincom)

```
use asminog\proxy\ProxyAction;

class SiteController extends Controller
{
    public function actions()
    {
        return [
            'proxy' => [
                'class' => ProxyAction::class,
                // 'accessToken' => 'your-access-token', // - set access token for secure requests
                // 'throw404Exception' => true, // - show 404 error if access token is not valid or request url is not valid
                // 'proxyHeaders' => ['User-Agent', 'Content-Type'], // - set headers for proxy request
                'proxyHeaders' => ['Authorization', 'Content-Type'], // - set headers for chatgpt proxy request
                // 'proxyCookies' => ['cookie1', 'cookie2'], // - set cookies for proxy request
            ],
        ];
    }
}
```

Example request through proxy on domain.com
-------------------------------------------

[](#example-request-through-proxy-on-domaincom)

```
        $this->client = new Client([
            'transport' => CurlTransport::class,
            'baseUrl' => 'https://domain.com/site/proxy', // - set url to your proxy action
            'requestConfig' => [
                'format' => Client::FORMAT_JSON,
                'headers' => [
                    'Authorization' => 'Bearer ' . $token,
                    'Content-Type' => 'application/json',
                    'X-Proxy-Url' => 'https://api.openai.com/v1/chat/completions', // - set url to your api
//                    'X-Access-Token' => 'your-access-token' // - set access token for secure requests
                ],
            ],
        ]);

        $response = $this->client->post('', [
            'model' => 'gpt-3.5-turbo',
            'messages' => [
                [
                    'role' => 'user',
                    'content' => 'Hello, how are you?',
                ],
            ],
        ]);

        if ($response->isOk) {
            $data = $response->data;
            // - do something with response data
        } else {
            // - handle error
        }
        $this->client->close();
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance47

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~34 days

Recently: every ~86 days

Total

11

Last Release

425d ago

PHP version history (2 changes)v0.0.1PHP ^8.1

v0.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/5894be6e4c72e162373be54daa7cea5200d4a97c088c96f3f373328eb31ceff8?d=identicon)[asminog](/maintainers/asminog)

---

Top Contributors

[![asminog](https://avatars.githubusercontent.com/u/1555548?v=4)](https://github.com/asminog "asminog (31 commits)")

---

Tags

proxyyii2extension

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[linslin/yii2-curl

Easy and nice cURL extension with RESTful support for Yii2

1811.5M20](/packages/linslin-yii2-curl)[bryglen/yii2-apns-gcm

Yii 2 Apns and Gcm together

54277.8k1](/packages/bryglen-yii2-apns-gcm)[hiqdev/yii2-hiart

ActiveRecord for API

5951.8k3](/packages/hiqdev-yii2-hiart)[joni-jones/yii2-wschat

Online chat based on web sockets and ratchet php

981.3k](/packages/joni-jones-yii2-wschat)[yiiplus/yii2-websocket

使用yii2封装 websocket 扩展

212.6k](/packages/yiiplus-yii2-websocket)[afinogen89/get-mail

Get Mail from POP3

116.8k](/packages/afinogen89-get-mail)

PHPackages © 2026

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