[extension] asminog/yii2-proxy


HTTP Proxy Extension for Yii 2

  1. Installation
  2. Usage

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
],
];
}
}