mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-11 10:56:29 +00:00
Default Curl::setProxyTunnel() to enable tunneling; Use Curl::setProxyTunnel() in proxy example
This commit is contained in:
@@ -273,7 +273,7 @@ Curl::setOpts($options)
|
||||
Curl::setPort($port)
|
||||
Curl::setProxy($proxy, $port = null, $username = null, $password = null)
|
||||
Curl::setProxyAuth($auth)
|
||||
Curl::setProxyTunnel($tunnel)
|
||||
Curl::setProxyTunnel($tunnel = true)
|
||||
Curl::setProxyType($type)
|
||||
Curl::setReferer($referer)
|
||||
Curl::setReferrer($referrer)
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ use \Curl\Curl;
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->setProxy('someproxy.com', '9999', 'username', 'password');
|
||||
$curl->setOpt(CURLOPT_HTTPPROXYTUNNEL, 1);
|
||||
$curl->setProxyTunnel();
|
||||
$curl->get('https://httpbin.org/get');
|
||||
var_dump($curl->response);
|
||||
|
||||
+1
-1
@@ -1071,7 +1071,7 @@ class Curl
|
||||
* @access public
|
||||
* @param $tunnel boolean
|
||||
*/
|
||||
public function setProxyTunnel($tunnel)
|
||||
public function setProxyTunnel($tunnel = true)
|
||||
{
|
||||
$this->setOpt(CURLOPT_HTTPPROXYTUNNEL, $tunnel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user