File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -721,16 +721,19 @@ public function setReturnFormat($return_format)
721
721
*/
722
722
public function setProxy ($ host , $ port , $ type = CURLPROXY_HTTP )
723
723
{
724
- $ this ->_proxy ['host ' ] = $ host ;
725
- $ this ->_proxy ['port ' ] = (int ) $ port ;
726
-
727
- static $ types = [
724
+ $ types = [
728
725
CURLPROXY_HTTP , CURLPROXY_SOCKS4 , CURLPROXY_SOCKS5 ,
729
- CURLPROXY_SOCKS4A , CURLPROXY_SOCKS5_HOSTNAME
726
+ CURLPROXY_SOCKS5_HOSTNAME
730
727
];
728
+ if (defined ('CURLPROXY_SOCKS4A ' )) {
729
+ $ types [] = CURLPROXY_SOCKS4A ;
730
+ }
731
731
if (! in_array ($ type , $ types )) {
732
732
throw new \Exception ('Invalid proxy type specified. ' );
733
733
}
734
+
735
+ $ this ->_proxy ['host ' ] = $ host ;
736
+ $ this ->_proxy ['port ' ] = (int ) $ port ;
734
737
$ this ->_proxy ['type ' ] = $ type ;
735
738
}
736
739
You can’t perform that action at this time.
0 commit comments