Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

  • Exits

  • Categories

  • Archives

  • Visitors’ track

    Locations of visitors to this page
  • Tags list

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:

PHP:
  1. $params['proxy_user'] = 'proxy_username';
  2. $params['proxy_pass'] = 'proxy_password';
  3. $params['proxy_host'] = 'proxy_hostname_or_ip';
  4. $params['proxy_port'] = 8080; // 3128, ...
  5.  
  6. // I assume $headers were set somewhere else
  7. $req = &new HTTP_Client($params, $headers);

If your proxy does not need authorization - just drop the proxy_user and proxy_pass parameters.

  • Share/Bookmark

One Response to “Using PEAR HTTP_Client or HTTP_Request with HTTP proxy”

  1. How to make PEAR work from behind an HTTP proxy (Windows and Linux) »Autarchy of the Private Cave Says:

    [...] Using PEAR HTTP_Client or HTTP_Request with HTTP proxy [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>