PHProxy Source Code README _____________________________________________________________________ Source Code Version 0.3 - July 22nd 2004 Latest Version: http://www.sourceforge.net/projects/poxy/ Copyright 2004 ultimategamer00 (Abdullah A.) Contact _____________________________________________________________________ Email and MSN: ultimategamer00@hotmail.com Website: http://www.whitefyre.com/poxy/ Support _____________________________________________________________________ http://www.sourceforge.net/projects/poxy/ Look for the forums Table of Contents _____________________________________________________________________ 1. License 2. What is PHProxy? 3. How it Works 4. Requirements 5. Installation 6. Configurable Script Variables 7. Available Options 8. Other Usages 9. Legal Disclaimer 10. ChangeLog, FAQ, TODO, LICENSE, Bugs, Limitations 11. Credits 1. License _____________________________________________________________________ This source code is released under the GPL. A copy of the license in provided in this package in the file named LICENSE.txt 2. What is PHProxy? _____________________________________________________________________ First, let me tell you that I'm aware that there are other projects named "PHProxy." This name is only temporary. I might change it, or not. PHProxy is a web HTTP (for now; FTP is not supprted yet) proxy designed to bypass proxy restrictions through a web interface very similar to the popular CGIProxy (http://www.jmarshall.com/tools/cgiproxy/). For example, in my university, the IT department blocks a lot of harmless websites simply because of their popularity. So I use this porgram to access those websites. 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. 3. How it Works _____________________________________________________________________ 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. Comments have yet to be added. 4. Requirements _____________________________________________________________________ - PHP version >= 4.2.0 with safe_mode turned Off - file_uploads turned On for HTTP file uploads. - JavaScript turned on for the browser. Setting the flags and encrypting the supplied URL initially requires the use of JavaScript. 5. Installation _____________________________________________________________________ Simply upload these files to a directory of your liking: - PHProxy.class.php - index.php - url_form.inc - javascript.js - style.css All you need to do now is to access index.php and start browsing! 6. Configurable Script Variables _____________________________________________________________________ These variables are available at the beginning of the PHProxy class. $flags: this array contains the default values for the browsing options which are explained in section 7. $allowed_hosts: this array contains entries for the domain names that the script is allowed to browse. For example, setting this variable to array('www.yahoo.com') will restrict the script to browse _only_ www.yahoo.com. If you'd like the script browse all subdomains within yahoo.com then instead of www.yahoo.com, set it to array('.yahoo.com'). The dot in the beginning tells the script to match all subdomains. To add more entries, simply seperate them with a comma. Example: array('.yahoo.com', '.fark.com'); $banned_hosts: this is the same as $allowed_hosts. But instead of defining an allow list, you could simply define the domain names that you do not wish the script to browse. This overrides $allowed_hosts. Use either one of them. 7. Available Options _____________________________________________________________________ These options are available to you through the web interface. You can also edit the default values in the class variable $flags. Values can either be 1 (true) or 0 (false). All values are defaulted to 1. +-------------------------------------------------------------------+ | Option | Explanation | +-------------------------------------------------------------------+ | Include Form | Includes a mini URL-form on every HTML page for | | | easier browsing. | | Remove Scripts | Remove all sorts of client-side scripting | | | (i.e. JavaScript). Removal is not perfect. Some | | | scripts might slip by here and there. | | Accept Cookies | Accept HTTP cookies | | Show Images | Show images. You might want to turn this off if | | | you want to save your server's bandwith. | | Show Referer | Show referring website in HTTP headers. This | | | will show the base URL for the website you're | | | currently viewing. Because many website disable | | | HotLinking, this can be quite useful. | +-------------------------------------------------------------------+ 8. Other Usages _____________________________________________________________________ Some people like to do special browsers (or "Mods" as some might call it) for certain websites. They basically browse a specified website after doing some alteration to HTML source. With PHProxy, this is very simple to do. Let's say you want to create a mod for http://www.whitefyre.com/, all you have to do is: 1. Set the variable $allowed_hosts to array('.whitefyre.com'); 2. Create a file called browser.php, for example, with these contents: start_transfer(isset($_GET['url']) ? $_GET['url'] : $PHProxy->encode_url('http://www.whitefyre.com/')); /* You can either echo out the HTML response, or do some further operations on it if you wish. Other types of files will be directly passed to the user. If you do not want to send the HTTP response headers, supply the first parameter as false, and you can send the later through $PHProxy->send_response_headers(); */ echo $PHProxy->return_response(); ?> 3. Call that file! 9. Legal Disclaimer _____________________________________________________________________ Since this script basically bypasses restrictions that were imposed on you, using it might be illegal in your country, school, office, or whatever. Even your host might not allow you to run it. Use it at your own risk. I will not be responsible for any damages done or any harm that might result from using this script. 10. ChangeLog, FAQ, TODO, LICENSE, Bugs, Limitations _____________________________________________________________________ Refer to the accompanying files. You can infer the limitations and bugs from the TODO file. 11. Credits ______________________________________________________________________ James Marshall (http://www.jmarshall.com/) for his excellent CGIProxy script which was a high inspiration and guide for me.