Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Apr 02, 2009 4:43 am 
Offline

Joined: Thu Apr 02, 2009 4:13 am
Posts: 1
Hi

I have a curl code which tries to open some URL.

If I access that url from browser it works fine but curl request is not returning anything.

I checked with the network guys , they say the request does not even come to proxy to block or allow the request.

I am supplying proxy paramenters to the curl request..though its not working...

Below is the code I am using (with test URL as google)


$filelocation="http://www.google.co.in";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $filelocation);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL,1);
curl_setopt($ch, CURLOPT_PRXY, 'proxyname');
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Pragma: "));
curl_setopt($ch, CURLOPT_PROXYPORT,'8080');
curl_setopt($ch, CURLOPT_PROXYPWD, 'Username:Password');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

$html=curl_exec($ch);
curl_close ($ch);

print $html;
exit;


Do anyone has a pointer ,with which I can debug this issue ? any other way to do it ? or something I need to modify in above code ?

Thanks,
Sourabh


Top
   
 Post subject:
PostPosted: Thu Apr 02, 2009 9:46 am 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
Might you need HTTP_USER_AGENT as well? I block requests that do not supply this to stop poorly written scanners and bots.

James


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group