Jump to content

Curl Proxy Help


JustinMs66@hotmail.com

Recommended Posts

I am trying to get curl to work with a proxy. But it never works! Is my code correct? I have tried many different proxy ip's, all having the same result!

For example, some came from here:

http://www.publicproxyservers.com/page1.html

 

$url = "http://google.com";
$proxy = "89.250.7.160:3128";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_HTTPproxyTUNNEL, 1);
curl_exec ($ch);
print print_r(curl_getinfo($ch));
curl_close($ch);

 

When it prints the info array, most of it has a value of "0"

 

Link to comment
https://forums.phpfreaks.com/topic/121443-curl-proxy-help/
Share on other sites

  • 3 months later...

Real question is: Why do you need a proxy?

this is the most silly question i ever seen. there are millions of proxy around and millions of people using proxies, go and ask them why they are using proxies.

 

[email protected]  i have same problem with , curl doesnt work on webhosts with proxies it can work on my localhost and on cmd but not on webhost, does anyone have idea about this

Link to comment
https://forums.phpfreaks.com/topic/121443-curl-proxy-help/#findComment-705771
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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