Skip to content

Commit 5b7bf2f

Browse files
committed
add http proxy for curl
1 parent 2e46339 commit 5b7bf2f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/Arhframe/Util/File.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ class File
2222
* @var
2323
*/
2424
private $extension;
25-
/**
26-
* @var
27-
*/
28-
private $content;
2925
/**
3026
* @var bool
3127
*/
@@ -176,6 +172,12 @@ private function curlGetContent($url)
176172
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
177173
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
178174
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
175+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
176+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
177+
$proxy = Proxy::getProxyHttp();
178+
if (!empty($proxy)) {
179+
curl_setopt($ch, CURLOPT_PROXY, $proxy);
180+
}
179181
$data = curl_exec($ch);
180182
curl_close($ch);
181183
return $data;

0 commit comments

Comments
 (0)