I am trying to do curl requests through my local xampp setup but my company has a firewall proxy that needs to authenticate on port 8080. Can I have apache login to this proxy authenticate and complete the curl requests?
A:
You can do it in your curl request
if for example you are coding in php
curl_setopt($this->ch, CURLOPT_PROXY, "http://proxy");
curl_setopt($this->ch, CURLOPT_PROXYPORT, 8080);
You will probably need to use CURLOPT_PROXYAUTH as well
or you may want to try setting HTTP_PROXY ENV variable
Shaun Hare
2010-10-22 16:56:00
This worked: curl_setopt($ch, CURLOPT_PROXY, "http://proxy");curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password"); curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
Andres
2010-10-22 18:26:21
How would I set the HTTP_PROXY ENV? Would this default all PHP outgoing request to use it?
Andres
2010-10-22 18:27:07
In a XAMPP installation, you can set the HTTP_PROXY ENV variable in the ./apache/conf/extra/http-xampp.conf file by adding the following line inside an <IfModule env_module> block: SetEnv HTTP_PROXY "http://username:pass@serveraddress:portnumber"
Andres
2010-10-25 20:00:43
How would I set the username and password? Btw this is a xampp setup on windows. Would I use htaccess? How?
Andres
2010-10-23 00:25:13