Topic awaiting preservation: PHP Web Proxying |
|
---|---|
Author | Thread |
Maniac (V) Mad Scientist From: :morF |
posted 08-05-2005 02:16
I've been doing some reasearch into this lately, trying to find out how it works and how I can build my own proxying script with PHP, if at all possible. I know that sites like anonymizer.com and so on exist and that I can use them, but my problem is that the proxy-protected environment I need to work in not only blocks sites I need to access (at one ponit they even blocked this place and, for some reason, google) but also any sites that can help me get around them. So it comes to hiding a proxying script on my own website and hoping that it's possible. The way I can see it working is that my script requests and loads the page whilst still on the server, then serves that to me, thus making the proxy on this end think that everything is flowing from my domain. Is this actually possible? and, if so, how? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-05-2005 05:12
Sure you just need to use fopen code: $wp=fopen($url,"r"); // here you receive content of page while(!feof($wp)) { echo fread($wp,4096); } fclose($wp);
code: ini_set('open_basedir','.');
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-05-2005 05:18
oh to make this a little easier to use you could also do something like make a frameset with an input field on the top that opens the page in a frame underneath. Then use the input as a psuedo address bar |
Maniac (V) Mad Scientist From: :morF |
posted 08-05-2005 09:54
Indeed... thanks much bit, that's exactly what I was looking for |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-05-2005 17:20
Actually that's not going to work that well because your browser is still going to pull in all the images etc from the external site. Not to mention all the links will be outside your frame. |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 08-05-2005 19:28
Here is a proxy written in Perl. I know you said you wanted to write one in PHP, but, I think the techniques used in this article could be transferd over to PHP and you could use it as an example of how an anonymizing proxy works. |