publishing-kit/http-proxy

PSR7-compliant HTTP caching proxy

0.0.4 2021-05-09 10:05 UTC

This package is auto-updated.

Last update: 2024-10-09 18:26:37 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.

Install

Via Composer

$ composer require publishing-kit/http-proxy

Usage

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 of Psr\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);

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email 450801+matthewbdaly@users.noreply.github.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.