- Saved searches
- Use saved searches to filter your results more quickly
- jenssegers/php-proxy
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- PHP-Proxy
- PHP-Proxy as an alternative to Glype
- PHP-Proxy vs PHPProxy
- Download PHP-Proxy
- Saved searches
- Use saved searches to filter your results more quickly
- License
- PHProxy/phproxy
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
A PHP proxy script with https and post support
jenssegers/php-proxy
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
added example block to handle bad responses
Git stats
Files
Failed to load latest commit information.
README.md
This is a HTTP/HTTPS proxy script that forwards requests to a different server and returns the response. The Proxy class uses PSR7 request/response objects as input/output, and uses Guzzle to do the actual HTTP request.
composer require jenssegers/proxy
The following example creates a request object, based on the current browser request, and forwards it to example.com . The RemoveEncodingFilter removes the encoding headers from the original response so that the current webserver can set these correctly.
use Proxy\Proxy; use Proxy\Adapter\Guzzle\GuzzleAdapter; use Proxy\Filter\RemoveEncodingFilter; use Laminas\Diactoros\ServerRequestFactory; // Create a PSR7 request based on the current browser request. $request = ServerRequestFactory::fromGlobals(); // Create a guzzle client $guzzle = new GuzzleHttp\Client(); // Create the proxy instance $proxy = new Proxy(new GuzzleAdapter($guzzle)); // Add a response filter that removes the encoding headers. $proxy->filter(new RemoveEncodingFilter()); try < // Forward the request and get the response. $response = $proxy->forward($request)->to('http://example.com'); // Output response to the browser. (new Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($response); > catch(\GuzzleHttp\Exception\BadResponseException $e) < // Correct way to handle bad responses (new Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($e->getResponse()); >
You can apply filters to the requests and responses using the middleware strategy:
$response = $proxy ->forward($request) ->filter(function ($request, $response, $next) < // Manipulate the request object. $request = $request->withHeader('User-Agent', 'FishBot/1.0'); // Call the next item in the middleware. $response = $next($request, $response); // Manipulate the response object. $response = $response->withHeader('X-Proxy-Foo', 'Bar'); return $response; >) ->to('http://example.com');
About
A PHP proxy script with https and post support
PHP-Proxy
PHP-Proxy is a web-based proxy script designed to be fast, easy to customize, and be able to provide support for complex sites such as YouTube and Facebook. There have been many other proxy software scripts in the past, such as Glype, PHProxy, CGIProxy, Surrogafier, ASProxy, Zelune. but all have either perished permanently or the creator has stopped updating them. This proxy script is intended to replace all others.
If you wish to see how this proxy script works in practice on a live server, visit unblockvideos.com which is powered by this very same software application.
PHP-Proxy as an alternative to Glype
The main motivation behind the creation of this project is to create a better alternative to Glype which at that time was extremely lacking in many features that I wanted. Latest version of Glype can be downloaded directly from their site on their download page, but most of their site appears to be down. If that is the case, you can download Glype 1.4 directly from our servers.
PHP-Proxy vs PHPProxy
Despite sharing almost the exact name, this proxy script has no relationship to the once popular PHPProxy script from whitefyre which has been officially discontinued on September 7 of 2007. However, its last version that was last updated in 2013, PHPProxy can still be downloaded from SourceForge, and it is still receving hundreds of downloads each week.
It is still usable for now, but there have been no updates or new features added to it for many years now. There are many similar function proxy scripts named «PHP Proxy», we were just the lucky ones to acquire such domain name. While PHPProxy is still being widely used, it is outdated, hard to customize and it breaks on many popular websites such as Facebook and YouTube.
Download PHP-Proxy
The method of installation depends on the type of web server that you have. I would recommend installing it via Composer using this command (replacing /var/www/ with the web directory of your choice):
composer create-project athlon1600/php-proxy-app:dev-master /var/www/
For those who do not have access to shell, for example, people on a shared hosting environment, would need to download a pre-installed version of php-proxy, and then upload it to their web-server.
One-Click Install — go rent out a fresh server from one of the popular VPS providers like Linode, and run the following command in your shell:
This will install both Apache2, PHP, cURL, and PHP-Proxy all at once.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
PHP based web proxy. Initially developed by whitefyre
License
PHProxy/phproxy
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
PHProxy is a web HTTP proxy written in PHP. It is designed to bypass proxy restrictions through a web interface very similar to the popular CGIProxy. The only thing that PHProxy needs is a web server with PHP installed (see Requirements below). Be aware though, that the sever has to be able to access those resources to deliver them to you.
Originaly developed in SourceForge during 2002-2007 and then abandoned. This project needs to live and it’s development is continued here.
This source code is released under the GPL. A copy of the license is provided in this package in the filename LICENSE.md .
- PHP version > 5
- safe_mode turned off or at least having the fsockopen() function not disabled
- OpenSSL for support for secure connections (https)
- Zlib for output compression
- file_uploads turned On for HTTP file uploads.
Copy the files of the repository in your public web server folder or to a directory of your liking (prefrebly in its own directory).
cd /var/www/html/ git clone https://github.com/PHProxy/phproxy.git
You simply supply a URL to the form and click Browse. The script then accesses that URL, and if it has any HTML contents, it modifies any URLs so that they point back to the script. Of course, there is more to it than this, but if you would like to know more in detail, view the source code.
PHP is restrictive by nature, and as such, some problems arise that would have not if this project were otherwise coded in another programming language. The first example of this is the dots in incoming variable names from POST and GET methods. In a normal programming language, this wouldn’t be a problem as these variables could be accessed normally as they are supplied, with dots included. In PHP, however, dots in GET, POST, and COOKIE variable names are magically transformed into underscores because of register_globals . Things like Yahoo! Mail which has dots in variable names will not work. There’s no easy way around this, but luckily, I have provided the solutions right here:
- I’ve already taken care of cookies by manually transforming the underscores manually into dots when needed.
- For GET variables, this shouldn’t be a huge problem since the URLs are URL-encoded into the url_var_name. The only time this should be an issue is when a GET form uses dots in input names, and this could be recitified by using $_SERVER[‘QUERY_STRING’], and parsing that variable. But this, luckily, doesn’t happen too often.
- As for POST data, one solution is to use $HTTP_RAW_POST_DATA. But then, this variable might not be available in certain PHP configurations, and it would need further parsing, and it still doesn’t account for uploaded FILES. This is extremely impractical and ugly.
The best thing you could do if you have enough control over your Web server and can compile custom builds of PHP is to delete a single line in a PHP source code file called «php_variables.c» located in the «main» directory. The function in question is called «php_register_variable_ex». I’ve only checked this with PHP v4.4.4 and the exact line to delete is 117th line which basically consists of this:
Now just compile and install PHP and everything should be fine. Just make sure that you have register_globals off or something might get messed up.
Another problem facing many Web proxies is support for JavaScript. The best thing you could do right now is to have the JavaScript disabled on your browsing options as most sites degrade gracefully, such as Gmail.
A third limitation for Web proxies is content accessed from within proxied Flash and Java applications and such. Since the proxy script doesn’t have access to the source code of these applications, the links which they may decide to stream or access will not be proxified. There’s no easy solution for this right now.
PHProxy also doesn’t support FTP. This may or may not be introduced in future releases, but there are no current plans for FTP support.