function HTTP_Request::setProxy in Flickr API 5
Sets a proxy to be used
@access public
Parameters
string Proxy host:
int Proxy port:
string Proxy username:
string Proxy password:
File
- phpFlickr/
PEAR/ HTTP/ Request.php, line 437
Class
- HTTP_Request
- Class for performing HTTP requests
Code
function setProxy($host, $port = 8080, $user = null, $pass = null) {
$this->_proxy_host = $host;
$this->_proxy_port = $port;
$this->_proxy_user = $user;
$this->_proxy_pass = $pass;
if (!empty($user)) {
$this
->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($user . ':' . $pass));
}
}