soma56 Posted July 25, 2011 Share Posted July 25, 2011 I'm working on an application that uses cURL but for the life of me I can't figure out why the proxy isn't working through cURL. The proxy works fine through Firefox. Here's a very simple example of cURL and with respect to how I'm trying to connect: <?PHP $url = 'http://www.mysite.com'; //URL to get $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); // no headers in the output curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // output to variable curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0); curl_setopt($ch, CURLOPT_PROXY, 'IP:PORT'); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25); $data = curl_exec($ch); curl_close($ch); return $data; echo $data; ?> Can anyone suggest why this wouldn't work with a working proxy? I'm dying here.... Link to comment https://forums.phpfreaks.com/topic/242792-proxy-works-fine-in-ff-but-not-in-curl/ Share on other sites More sharing options...
phpSensei Posted July 25, 2011 Share Posted July 25, 2011 Try ptting in the ip/port curl_setopt($ch, CURLOPT_PROXY, '128.114.63.15:3128'); Link to comment https://forums.phpfreaks.com/topic/242792-proxy-works-fine-in-ff-but-not-in-curl/#findComment-1247041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.