Jump to content

php and proxies


phporcaffeine

Recommended Posts

I'm trying my hand at making an internet content filter and making the proxy from php.

 

Basically, the browser is told to look at xxx.xxx.xxx.xxx as the proxy, that ip address is a machine running php.

 

Now php catches the request and does whatever I want it to to determin if the request is allowed.  If its allowed it should return the original request.

 

 

It is sort of working .... anything on the root of the requested domain is displayed but when the documents on the root make references elsewhere, it bombs.

 

If anyone has any clues, ideas or if there is a pre-built that someone knows of I'd be grateful!

 

 

so far ....

 

<?php

$url = $_SERVER['HTTP_HOST'];

$parts = parse_url($url);

$test = substr($url, 0, 4);

if (strtolower($test) != "http") {

$url = "http://" . $url;
}

echo $url;

$doc = file_get_contents($url . $parts['query']);

echo $doc;

die();

?>

 

-TIA

Link to comment
https://forums.phpfreaks.com/topic/68880-php-and-proxies/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.