Skip to content

Commit

Permalink
Add proxy support
Browse files Browse the repository at this point in the history
Implements HTTP(S) proxy support via new setProxy method.
Credit also goes to Petr Braun <[email protected]> who helped
implementing this commit.
  • Loading branch information
MichalMMac committed Mar 13, 2018
1 parent 9e60ff0 commit 14fb95a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Vimeo/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,22 @@ public function setCURLOptions($curl_opts = array())
$this->_curl_opts = $curl_opts;
}

/**
* @param $proxyAddress mandatory address of proxy
* @param null $proxyPort optional number of port
* @param null $proxyPass optional user:password authentication
*/
public function setProxy($proxyAddress, $proxyPort=null, $proxyUserPwd=null)
{
$this->CURL_DEFAULTS[CURLOPT_PROXY] = $proxyAddress;
if ($proxyPort) {
$this->CURL_DEFAULTS[CURLOPT_PROXYPORT] = $proxyPort;
}
if ($proxyUserPwd) {
$this->CURL_DEFAULTS[CURLOPT_PROXYUSERPWD] = $proxyUserPwd;
}
}

/**
* Convert the raw headers string into an associated array
*
Expand Down

0 comments on commit 14fb95a

Please sign in to comment.