PHP Snippet: Reverse Proxy ?

I’m not suffering from Blog Burnout, just a little playstation distraction ;) Actually, I’ve spent a lot of time learning PHP for my potential new project; during this I found the function: file_get_contents, which in turn leads me to ask:

Is it possible to make a PHP Reverse proxy ?

I’m thinking yes, but it wouldn’t be easy. file_get_contents allows you to open a file or even a URL from a PHP script running on your webserver, just this simple thought gave birth to this snippet of code:


<?php
$URL=$_GET
["url"];
$self=$_SERVER["PHP_SELF"];

if ( $URL == "") {
?>
No URL Given:

Try <a HREF="<?php echo $self; ?>?url=http://www.linickx.com"><?php echo $self ;?>?url=http://www.linickx.com</a>
<?php
} else {
$PAGE = file_get_contents($URL);

echo "$PAGE";

}
?>

As you can see it allows a user to send a url , which the server downloads and delivers to their browser. Now before anyone puts this onto a webserver you should be aware of the MASSIVE Security Issue, any user that opens the page can ask the server to open any file, e.g /etc/passwd or a malicious URL.

If you do try it, you’ll find that the page doesn’t look right or links don’t work, or even that pictures have loaded, but they were delivered directly to the browser, not from the server. That’s because no re-writing is taking place (that’s the hard bit) , but with companies like whale & juniper investing huge sums of money in SSL vpns, which is simply a reverse proxy with a bit of ssl tunneling, I don’t suppose it’ll be long ;)

New Wallpaper – GnomeGhost

Another mad moment, and another wallpaper.

This time I couldn’t decide which version to publish so here’s 2 !

Gnome2GhostGnomeGhost

At first I followed the art.gnome theme, and kept the foot sharp & crisp, and then I thought it’d be more ghostly if the foot was faded, but I still can’t decide which is better, maybe the folks at gnome-look will have an opinion.

Which actually reminds me of something weird, “gnome art” opinions, you’d think that the generally good wallpapers would be easily recognisable, but when it come to my CodenameGnome piece, the folks at art.gnome didn’t release it, but it’s actually my highest ranked at gnome-look, I guess it goes to show how wrong I was ! ;)

Retro Gaming Heaven – NES Style

X-Mas about 15yrs ago a small boy’s dream came true when his parents brought him a Nintendo Entertainment System (NES) and now, direct from eBay for £40 the revival, sweeeeeet retro gaming heaven ! :cool:

I’ve got a TVcard on my desktop at work so here are some screenshots and a couple of cam-phone picy’s for you enjoyment.

Hello PS2

If I’m not messing with linux, then I’m playing PS2.

This website just doesn’t reflect that, so I’ve updated the ps2 section to include all my games, not just the ones I’ve completed.

The ps2linux section has also taken the sideline until I have some content

Here’s a screen shot of what I’m playing at the moment ;)

StarWars Revenge of the Sith

StarWars Revenge of the Sith

I hope my reviews help anyone who’s having difficulty choosing good games :cool: