Yeah, that looks like a custom function planetsim. Really needs some comments :p
Here's one I wrote to get around my proxy a while ago when pulling the slashdot RSS feed. It was a quick and dirty script, so i'm sure someone can make it better. Any ideas?
<?
function damnProxy($page, $proxyHost, $proxyPort) {
$data = fsockopen($proxyHost, $proxyPort);
if(!$data) {
fclose($result);
echo "Cannot access ".$page;
}
else {
fputs($data,"GET $page HTTP/1.0\n\n");
while(!feof($data)) {
$cont=$cont.fread($data,4096);
}
}
fclose($data);
return substr($cont,strpos($cont,"\r\n\r\n")+4);
}
$slash = damnProxy("http://slashdot.org/slashdot.rdf", "proxy.yourcompany.com", 8080);
if($slash) {
echo $slash;
}
else {
echo "damned proxy";
}
?>