Using PEAR HTTP_Client or HTTP_Request with HTTP proxy
6th September 2006
If you happen to write PHP script, which uses either HTTP_Client or its dependancy HTTP_Request from PEAR, and the script is supposed to work through the HTTP proxy – here are the sample settings you need:
- $params['proxy_user'] = 'proxy_username';
- $params['proxy_pass'] = 'proxy_password';
- $params['proxy_host'] = 'proxy_hostname_or_ip';
- $params['proxy_port'] = 8080; // 3128, ...
- // I assume $headers were set somewhere else
- $req = &new HTTP_Client($params, $headers);
If your proxy does not need authorization – just drop the proxy_user and proxy_pass parameters.
October 19th, 2009 at 16:49
[...] Using PEAR HTTP_Client or HTTP_Request with HTTP proxy [...]