Before anything, download the complete version from SourceForge, to be able to read its licence (Free GPL Licence) and to better follow my instructions if you find yourself a little lost.
Lets start now ! First thing, open your HTML editor (It can be Notepad, Notepad ++ or any other WYSIWYG program like DreamWeaver and InstantLP ..) and create a PHP file named “Index.php”. This file will be the most important one and the leader of the proxy server. You have to only modify configurable variables, which will define what the user will be able to do and what he will see exactly :
//
// CONFIGURABLE OPTIONS
//
$_config = array
(
‘url_var_name’ => ‘q’,
‘flags_var_name’ => ‘hl’,
‘get_form_name’ => ‘____pgfa’,
‘basic_auth_var_name’ => ‘____pbavn’,
‘max_file_size’ => -1,
‘allow_hotlinking’ => 0,
‘upon_hotlink’ => 1,
‘compress_output’ => 0
);
$_flags = array
(
‘include_form’ => 1,
‘remove_scripts’ => 1,
‘accept_cookies’ => 1,
‘show_images’ => 1,
‘show_referer’ => 1,
‘rotate13′ => 0,
‘base64_encode’ => 1,
‘strip_meta’ => 1,
‘strip_title’ => 0,
‘session_cookies’ => 1
);
$_frozen_flags = array
(
‘include_form’ => 0,
‘remove_scripts’ => 0,
‘accept_cookies’ => 0,
‘show_images’ => 0,
‘show_referer’ => 0,
‘rotate13′ => 0,
‘base64_encode’ => 0,
‘strip_meta’ => 0,
‘strip_title’ => 0,
‘session_cookies’ => 0
);
$_labels = array
(
‘include_form’ => array(‘Include Form’, ‘Include mini URL-form on every page’),
‘remove_scripts’ => array(‘Remove Scripts’, ‘Remove client-side scripting (i.e JavaScript)’),
‘accept_cookies’ => array(‘Accept Cookies’, ‘Allow cookies to be stored’),
‘show_images’ => array(‘Show Images’, ‘Show images on browsed pages’),
‘show_referer’ => array(‘Show Referer’, ‘Show actual referring Website’),
‘rotate13′ => array(‘Rotate13′, ‘Use ROT13 encoding on the address’),
‘base64_encode’ => array(‘Base64′, ‘Use base64 encodng on the address’),
‘strip_meta’ => array(‘Strip Meta’, ‘Strip meta information tags from pages’),
‘strip_title’ => array(‘Strip Title’, ‘Strip page title’),
‘session_cookies’ => array(‘Session Cookies’, ‘Store cookies for this session only’)
);
$_hosts = array
(
‘#^127\.|192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[01])\.|localhost#i’
);
$_hotlink_domains = array();
$_insert = array();
//
// END CONFIGURABLE OPTIONS.
//
Don’t forget to open and close your <?php ?> tags or nothing will work. You can also choose to show or not errors on the page, an option that can help you a lot before publishing your proxy as it explain on which line error where found and why exactly. For that you have to just add this : error_reporting(E_ALL);
Next thing will be to copy the full content (rest) of the source index file, don’t touch to anything into it, even a simple point (.) can make all your proxy not working, so take care of what you modify !
The result of we have created until now will give us something like this screenshot (Our version is clean of CSS and design) :
Now, just save your file and create another new one, which will be also the last one (and yes ! two files can create a powerful proxy server !). The new file will be named index.inc.php. It will contain the front office part (what visitor will see) and the HTML tags.
We will start it by the header :
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en-US” xml:lang=”en-US“>
<head>
<title>My New Proxy</title>
</head>
You can change the title of corse and add any header meta tag you want, as long it don’t call PHP problem makers
For next part, I will just put comments between things to not make this tutorial longer. You can copy paste it identical or modify it or even just delete my comments ! (Comment will be red and preceded by a /* sign)
<body onload=”document.getElementById(‘address_box’).focus()”> /* This will put the mouse of the visitor on the address box, by focusing the mouse on it.
<div id=”container”>
<h1 id=”title”>PHProxy</h1>
<ul id=”navigation”>
<li><a href=”<?php echo $GLOBALS['_script_base'] ?>”>URL Form</a></li>
<li><a href=”javascript:alert(‘cookie managment has not been implemented yet’)”>Manage Cookies</a></li>
</ul>
<?php
switch ($data['category'])
{
case ‘auth’:
?>
<div id=”auth”><p>
<b>Enter your username and password for “<?php echo htmlspecialchars($data['realm']) ?>” on <?php echo $GLOBALS['_url_parts']['host'] ?></b>
<form method=”post” action=”">
<input type=”hidden” name=”<?php echo $GLOBALS['_config']['basic_auth_var_name'] ?>” value=”<?php echo base64_encode($data['realm']) ?>” />
<label>Username <input type=”text” name=”username” value=”" /></label> <label>Password <input type=”password” name=”password” value=”" /></label> <input type=”submit” value=”Login” /> /* On submit, this will drive user to enter into the anonymous server, which start the proxy functionality.
</form></p></div>
<?php
break;
case ‘error’:
echo ‘<div id=”error”><p>’;
switch ($data['group'])
{
case ‘url’:
echo ‘<b>URL Error (‘ . $data['error'] . ‘)</b>: ‘;
switch ($data['type'])
{
case ‘internal’:
$message = ‘Failed to connect to the specified host. ‘
. ‘Possible problems are that the server was not found, the connection timed out, or the connection refused by the host. ‘
. ‘Try connecting again and check if the address is correct.’;
break;
case ‘external’:
switch ($data['error'])
{
case 1:
$message = ‘The URL you\’re attempting to access is blacklisted by this server. Please select another URL.’;
case 2:
$message = ‘The URL you entered is malformed. Please check whether you entered the correct URL or not.’;
break;
}
break;
}
break;
case ‘resource’:
echo ‘<b>Resource Error:</b> ‘;
switch ($data['type'])
{
case ‘file_size’:
$message = ‘The file your are attempting to download is too large.<br />’
. ‘Maxiumum permissible file size is <b>’ . number_format($GLOBALS['_config']['max_file_size']/1048576, 2) . ‘ MB</b><br />’
. ‘Requested file size is <b>’ . number_format($GLOBALS['_content_length']/1048576, 2) . ‘ MB</b>’;
break;
case ‘hotlinking’:
$message = ‘It appears that you are trying to access a resource through this proxy from a remote Website.<br />’
. ‘For security reasons, please use the form below to do so.’;
break;
}
break;
}
echo ‘An error has occured while trying to browse through the proxy. <br />’ . $message . ‘</p></div>’;
break;
}
?>
<form method=”post” action=”<?php echo $_SERVER['PHP_SELF'] ?>”> /* This will post the form to same file, and start the proxy.
<ul id=”form”>
<li id=”address_bar”><label>Web Address <input id=”address_box” type=”text” name=”<?php echo $GLOBALS['_config']['url_var_name'] ?>” value=”<?php echo isset($GLOBALS['_url']) ? htmlspecialchars($GLOBALS['_url']) : ” ?>” onfocus=”this.select()” /></label> <input id=”go” type=”submit” value=”Go” /></li>
<?php
foreach ($GLOBALS['_flags'] as $flag_name => $flag_value)
{
if (!$GLOBALS['_frozen_flags'][$flag_name])
{
echo ‘<li><label><input type=”checkbox” name=”‘ . $GLOBALS['_config']['flags_var_name'] . ‘[' . $flag_name . ']“‘ . ($flag_value ? ‘ checked=”checked”‘ : ”) . ‘ />’ . $GLOBALS['_labels'][$flag_name][1] . ‘</label></li>’ . “\n”;
}
}
?>
</ul>
</form>
<!– The least you could do is leave this link back as it is. This software is provided for free and I ask nothing in return except that you leave this link intact
You’re more likely to recieve support should you require some if I see a link back in your installation than if not –>
<div id=”footer”><a href=”http://whitefyre.com/poxy/”>PHProxy</a> <?php echo $GLOBALS['_version'] ?></div>
And now, we close opened tags :
</div>
</body>
</html>
That’s all ! You can now design your proxy server by adding some style on it and may be pictures ? Anyway, on this tutorial, there is not too much comments, I tried to make it as simple as I can, but it is already very simple to learn, functions are clear and very clean. You can ask me about any kind of help and I will try to reply with as much details as I can. Please don’t forget to download the full script from SourceForge as version of files there are may be newer and can be cleaner and easier if you just want to modify simple variables (described on top) and launch your Proxy !
Related Posts :
- How to add a custom logo to the free Titan theme for Wordpress Customise your blog and save yourself some cash in the process. I decided that the default text heading on the free version of the Titan theme for my WordPress blog was too boring. So by putting my limited CSS knowledge to the test I succeeded...
- Introduction to the Trumpet, pt 2 From the long mouthpieces that the slide trumpet was known for, developed the idea of creating a separate mouthpiece for natural trumpets. The basic design for the mouthpiece during the 16th century and the 17th century was a cupped shape that had a sharp edge...
- phpSEO - Class for better SEO in PHP I've been working all the free time I had this week in the class to make better SEO in your PHP. Few days a go I posted about some SEO functions for PHP but was still too many things to improve. Basic usage: $seo =...
- Simple cache for PHP Maybe not many of you already know that I had a dark side. Yes I was developing in ASP for long time...... I actually still like it, and because of that I like that much PHP (Well love it). Everything is lot better in PHP,...
- Cecilio CVN-200 4/4 Full Size Rosewood Violin w/ Case and Accessories User Reviews Send this to a friend Cecilio CVN-200 4/4 Full Size Rosewood Violin w/ Case and Accessories Manufacturer: Cecilio Instruments Customer Rating: List Price: $299.95 Sale Price: $90.00 Availibility: Usually ships in 24 hours Free Shipping Available Buy Now Product Description This violin is...
Related posts:
- About KVCHosting.com I think that many of you, my dear visitors, know what is web hosting, and for what we use it. If you don''t, a web hosting service is simply a host for your website, like...
- How to create your own job portail website? You have certainly heard about GetaFreelancer, Rentacoder and Odesk, where you can find online part-time jobs or recruit online workers, but, what about starting your own project of hiring freelancers for buyers ? It's not...
- PremusHost : Premium Web Hosting Template PremusHost template is a CSS/HTML clean and clear optimized template for Web Hosting related websites. It will transform your web hosting services to gold as it will attract more clients and make them feel the...
- How To Repair Windows XP File System Using SFC If your PC is running XP, chances are that you will know when there is a problem with the file system. Typically you start to receive file related errors. If ignored, this could turn into...
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] this article: Create your own Proxy server ! | Coffee Cup Break Posteado por: yoobz on March 7, [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
[...] Create your own Proxy server ! | Coffee Cup Break [...]
Like or Dislike ?
0
0
hii..
i want to build an http caching proxy server using java.
can u guid and help me..?
Like or Dislike ?
0
0
Yes, contact me via the contact page and I’ll try to help as much as I can !
Like or Dislike ?
0
0
Hello,
I am regular visitor of this website.http://www.coffeecupbreak.com is filled with quality info. Do you pay attention towards your health?. Let me show you one truth. Recent Scientific Research presents that about 50% of all U.S. adults are either obese or weighty. Hence if you’re one of these individuals, you’re not alone. Its true that we all can’t be like Brad Pitt, Angelina Jolie, Megan Fox, and have sexy and perfect six pack abs. Now the question is how you are planning to have quick weight loss? Quick weight loss can be achived with little effort. You need to improve some of you daily habbits to achive weight loss in short span of time.
About me: I am author of Quick weight loss tips. I am also health expert who can help you lose weight quickly. If you do not want to go under difficult training program than you may also try Acai Berry or Colon Cleansing for quick weight loss.
Like or Dislike ?
0
1
Very nice site! is it yours too
Like or Dislike ?
0
1