Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.