asminog / yii2-proxy
HTTP proxy action extension for the Yii framework
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.4
- yiisoft/yii2-httpclient: ~2.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.8
README
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.
For license information check the LICENSE-file.
Installation
composer require asminog/yii2-proxy
Usage
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 // 'proxyCookies' => ['cookie1', 'cookie2'], // - set cookies for proxy request ], ]; } }