PHP Proxy
The php proxy is used here to let the server retrieving the feed informations instead of using guest's internet connections.
You will just have to change in my Javascript the feed_Module1 variable to such url format proxy.php?url=yourfeed, for example:
Code:
http://yourwebsite.com/proxy.php?url=http://milw0rm.com/js/3.0/remote.php
and also update the feed urls in the proxy.php to match yours, this is a security check to avoid the use of the proxy with unauthorised urls.
Proxy.php code:
PHP Code:
<?php
$post_data = $HTTP_RAW_POST_DATA;
$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($post_data);
$ch = curl_init( $_GET['url'] );
$urlx=$_GET['url'];
$check1='http://milw0rm.com/js/3.0/remote.php';$check2='http://milw0rm.com/js/3.0/local.php';$check3='http://milw0rm.com/js/3.0/webapps.php';
$check4='http://milw0rm.com/js/3.0/dos.php';$check5='http://www.sophos.com/virusinfo/infofeed/tenalerts.js';$check6='http://securityresponse.symantec.com/avcenter/js/tools.js';
$check7='http://securityresponse.symantec.com/avcenter/js/vir.js';
if(!strstr($urlx,$check1)&&!strstr($urlx,$check2)&&!strstr($urlx,$check3)&&!strstr($urlx,$check4)&&
!strstr($urlx,$check5)&&!strstr($urlx,$check6)&&!strstr($urlx,$check7)&&!strstr($urlx,$check8))
{
echo('Not Authorized');
return;
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
$response = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
print $response;
}
?>