Tuesday, December 27, 2011

Making a curl request behind a proxy

Set following additional curl options in order to make a curl request behind an http proxy:

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL,TRUE);
curl_setopt($ch, CURLOPT_PROXYAUTH,CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_PROXY,'proxyname or proxyIP:portnumber');

Creative Commons License

No comments:

Post a Comment