Jump to content

Curl Proxy Help


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

 

JustinMs66@hotmail.com  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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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