PSR7-compliant HTTP caching proxy
PublishingKit/http-proxy is a simple reverse caching HTTP proxy. Rather than doing any actual caching itself, it's instead implemented as a very simple HTTPlug client, which is wrapped in the HTTPlug caching plugin.
$ composer require publishing-kit/http-proxy
Assuming the following:
$appis a callable (can be a function, or a class with the
__invoke()magic method defined) that accepts a PSR7 request object as its sole argument
$cacheis an instance of
$streamFactoryis an HTTPlug stream factory implementation
$app = new App(); $client = new PublishingKit\HttpProxy\Client($app); $proxy = new PublishingKit\HttpProxy\Proxy($client, $cache, $streamFactory); $response = $proxy->handle($request);
Please see CHANGELOG for more information on what has changed recently.
$ composer test
If you discover any security related issues, please email email@example.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.