A web proxy for IP/domain-protected content access (such as online libraries, content providers etc.). Built with php.
A web proxy for remote-content access built with php.A simple, NOT anonymous web proxy that is useful for letting users access IP/domain-protected sites such as online libraries and content providers from wherever they are ("off-campus"). It is a simple and effective alternative to the commerical product "EZProxy".
The core functionality can be found within
proxy.phpwhich can very easily be plugged into an existing project. The additional files are absolutely enough for a simple system with a limited number of users, and can be modified an scaled to meet your needs (e.g. add a users database, multiple proxied hosts etc.)
However, when uploading the files to the server, web access to the root directory must not be in an internal folder. The base URL for the web proxy should be something like
https://www.my-website.com/proxy. That is to allow the proxied source to take over the web path.
Edit the hostname that you want proxied: Open
index.phpand edit the
Proxy with some special functionality defined by you ("plugin" - read bellow for more info):
proxify('http', 'example.com', 'plugin_name');
- Simple usage
Edit predefined users: Open
usersand edit according to the following pattern (user details separated with
So for the user "John Doe" with the email "email@example.com" and with the password "12345" we'll have:
email (username):md5-hashed password:name
Each user is defined in a new line.
https://proxy-address, enter a user's details, and enjoy! (seriously). You can find the default user credentials below (see "additional useful info").
However, the most appealing reason I see for using a plugin is for tweaking the HTML response do change the webpage "just a little bit", e.g. add your organization logo or greet the user (after all, you the user's details).
A plugin should be:
- In a file named
- With the function
[plugin-name]_init($response)inside the file.
$responseparameter is an array with following keys/values:
content-type: the content (MIME) type of the response.
eff-url: the "effective" url - the actual URL of the page after redirects (if there were any)
body: the response body (as HTML, CSS, JS or whatever)
- Bear in mind that all the cookies from the source are always forwarded the end-user.
- Any external call from the page (call for frames; JS; CSS;) are NOT proxied by default and that is because the proxy isn't intended to be anonymous and such calls are usually not restricted to a specific IP/domain. Direct requests to external assets make the user experience faster. If you want to proxy these too, you can use a plugin to overwrite URLs.
- Default user credentials:
- Username: firstname.lastname@example.org; Password: 12345
- Username: email@example.com; Password: 123456
- Username: firstname.lastname@example.org; Password: 1234567