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.
Via Composer
$ composer require publishing-kit/http-proxy
Assuming the following:
$app
is 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$cache
is an instance ofPsr\Cache\CacheItemPoolInterface
$streamFactory
is 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
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email 450801+matthewbdaly@users.noreply.github.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.