a few words about web development

Download SimpleWebProxy.php

Forwarding HTTP requests through PHP
Here's my web proxy written entirely in PHP with no external programs or libraries. Works under Linux, Windows and, most likely, everywhere else too.

This proxy leaves JavaScript files intact since there is no safe way to handle Javascript files though webproxy as they can always tell the URL is not the correct one. Everything else goes thought it- images, HTML, CSS, videos and even downloads.
This proxy also caches images in the "cache" directory. It speeds things a lot. Caching other files is not implemented here, buy it's very easy to extend the code to meet your needs. The code is very short, not even 3 kB so you should not have any problems understanding it.

Requires curl PHP extension, which is enabled on most webservers.

Example usage:


<?php
include 'SimpleWebProxy.php';
$proxy = new SimpleWebProxy($_GET['url']);

License: MIT


Comments