Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amphp/aerys-reverse
Reverse HTTP proxy handler for Aerys
https://github.com/amphp/aerys-reverse
aerys amphp php
Last synced: about 2 months ago
JSON representation
Reverse HTTP proxy handler for Aerys
- Host: GitHub
- URL: https://github.com/amphp/aerys-reverse
- Owner: amphp
- License: mit
- Created: 2016-01-23T18:38:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-30T21:03:52.000Z (about 7 years ago)
- Last Synced: 2024-07-30T16:53:34.085Z (5 months ago)
- Topics: aerys, amphp, php
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 16
- Watchers: 8
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Aerys Reverse
![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)
`amphp/aerys-reverse` is a reverse HTTP proxy handler for use with the [`Aerys`](https://github.com/amphp/aerys)
webserver.---
**EXPERIMENTAL, USE AT YOUR OWN RISK!**
---
**Required PHP Version**
- PHP 7.0+
**Installation**
```bash
composer require amphp/aerys-reverse
```## Usage
```PHP
use(new Aerys\ReverseProxy("https://amphp.org/", ["Host" => ["amphp.org"]]);
```Now all requests to the webserver are reverse proxied to https://amphp.org/, with all the headers preserved and the `Host` header set to `amphp.org`.
Alternatively one also can pass a callable as second parameter, which then gets all the headers in and should return the headers to send.
As optional third argument an `Amp\Artax\Client` instance can be passed (should use `NullCookieJar`) to setup certain options.