Skip to content

Commit f53c11c

Browse files
authored
Merge pull request #1 from kristapsk/CURLOPT_PROXYTYPE
Support SOCKS proxies in addition to HTTP
2 parents 4f002c1 + 546e804 commit f53c11c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/BrowserClient.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,24 @@ public static function setStorageDirectory($path)
4848
/**
4949
* Format ip:port or null to use direct connection
5050
* @param $proxy_server
51+
* @param $proxy_type
5152
*/
52-
public function setProxy($proxy_server)
53+
public function setProxy($proxy_server, $proxy_type = CURLPROXY_HTTP)
5354
{
5455
$this->options[CURLOPT_PROXY] = $proxy_server;
56+
$this->options[CURLOPT_PROXYTYPE] = $proxy_type;
5557
}
5658

5759
public function getProxy()
5860
{
5961
return !empty($this->options[CURLOPT_PROXY]) ? $this->options[CURLOPT_PROXY] : null;
6062
}
6163

64+
public function getProxyType()
65+
{
66+
return !empty($this->options[CURLOPT_PROXYTYPE]) ? $this->options[CURLOPT_PROXYTYPE] : null;
67+
}
68+
6269
public function setCookieFile($cookie_file)
6370
{
6471
$this->cookie_file = $cookie_file;

0 commit comments

Comments
 (0)