Hello All!

I want to create my own proxy site. I googled alot and I find not a single solution in .net to do this. Everyone is using php for it. I am very new to php so i dont know how to use it. here is the code i found on net.

<?php
$url = 'http://www.cnn.com';
$proxy_port = 80;
$proxy = '92.105.140.115';
$timeout = 0;
$referer = 'http://www.mydomain.com'


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);*/
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);       
curl_setopt($ch, CURLOPT_REFERER, $referer);

$data = curl_exec($ch);
curl_close($ch);
echo $data; 
?>

My question is, Do I need to have proxy server for proxy site ? or I can just give my server address in $proxy ?

Regards

Hello,
First of all let talk a bit about what is the meaning of using CURLOPT_PROXY (http://www.php.net/curl_setopt ) . The meaning is that you are going to use one other proxy server to fulfil the request and finally give results to your visitor. As I understood this has nothing to do with what you are trying to accomplish.

There are several things you should take care creating a proxy. The first is your own server security but that should be a complete new thread because it is a wide issue. The second is to serve the same content in same content type as requested under your proxy server access … meaning images, JavaScripts , CSS and everything.

There are many issues with your project but if it is just educational to understand how things work then you are fine. I wish you the best about it and don’t forget that we are here to provide you our opinions (and *knowledge) in any stage.

Thanks for your reply. I had done with my work. here is the link of my testing siteClick Here username = admin and password: admin. I took this code from net just add and remove few features as i required.
Files are also attached with this post so others may also get help from it.

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.