Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 75 | All time: 10,197 This week: 673![]() |
Version | License | PHP version | Categories | |||
proxy 1.0 | MIT/X Consortium ... | 5 | Networking, HTTP, PHP 5 |
Description | Author | |
This package can be used to forward HTTP requests to other servers as a proxy. |
Simple Php Proxy based on Guzzle.
Use Composer...
composer require frdl/proxy
...or the Webfan Installer if you would like to build a larger project.
<?php
use frdl\Proxy\Proxy;
require 'vendor/autoload.php';
$proxy = (new Proxy(null,
$_SERVER['REQUEST_URI'],
'green.example.com', //target host
$_SERVER['HTTP_HOST'], //User Input, forward optionaly*
$_SERVER['REQUEST_METHOD'],
'https',
false))
->withFakeHost(true) //*Do overwrite/not use users host header
//...or...
->withFakeHeader('X-Forwarded-Host')
;
$proxy->handle(true);
Internally the proxy ignores the bounce
-detection silently to fallback to any localhost scripts.
You can use it before/without handling the HTTP-Forwarding, e.g. to perform a (test-)request on the same host.
<?php
if(!$proxy->bounce()){
$proxy = (new Proxy('blue',
$_SERVER['REQUEST_URI'],
'blue.example.com', //target host
'example.com', //set the host header on the target script
$_SERVER['REQUEST_METHOD'],
'https',
true))
->handle(true);
}
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Read me |
![]() |
/ | src |
File | Role | Description |
---|---|---|
![]() ![]() |
Class | Class source |
![]() ![]() |
Class | Class source |
![]() ![]() |
Class | Class source |
![]() ![]() |
Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.