publishing-kit / http-proxy
PSR7-compliant HTTP caching proxy
0.0.4
2021-05-09 10:05 UTC
Requires
- php: >=7.4
- php-http/cache-plugin: ^1.7
- php-http/httplug: ^2.1
- php-http/message: ^1.8
- psr/cache: ^1.0
Requires (Dev)
- infection/infection: ^0.15.0
- mockery/mockery: ^1.3
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: >=8.0
- squizlabs/php_codesniffer: ^3.0
- tedivm/stash: ^0.15.2
- vimeo/psalm: ^4.3
This package is auto-updated.
Last update: 2024-10-09 18:26:37 UTC
README
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 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);
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.