cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-and-php mailing list Archives

No content via proxy

From: Mindaugas Lipskas <manxp_at_freemail.lt>
Date: Fri, 20 Apr 2007 01:11:22 +0300

Hello everyone,

I started playing with curl some time ago and everything was great, but I
experience troubles trying to get curl working with proxy. It simply does
not work, and the code is so simple, that I have no idea what can be wrong
here. This is my script, which should connect to site via proxy and simply
display site's content:

<?php
$proxy_ip="xxx";
$proxy_port="8080";

$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, "$proxy_ip:$proxy_port");
curl_setopt($ch, CURLOPT_TIMEOUT, '30');

$post=curl_exec($ch);
curl_close($ch);
print $post;
?>

When I run it, no content is displayed, only blank page. Proxy server is ok
(I tried many different proxies, and all of them work fine with browser, but
no one works with curl).

Server is running Cpanel with PHP 4.4.4 and curl 7.15.3

If you have any ideas, please share.

Thank you!

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-04-20

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET