add clear
This commit is contained in:
@@ -337,7 +337,6 @@ class HttpClient
|
|||||||
*/
|
*/
|
||||||
private function coroutine($ip, $url, $data = [])
|
private function coroutine($ip, $url, $data = [])
|
||||||
{
|
{
|
||||||
echo $ip . ':' . $url . PHP_EOL;
|
|
||||||
$client = $this->generate_client($ip, $url, $data);
|
$client = $this->generate_client($ip, $url, $data);
|
||||||
if ($client->statusCode < 0) {
|
if ($client->statusCode < 0) {
|
||||||
throw new \Exception($client->errMsg);
|
throw new \Exception($client->errMsg);
|
||||||
@@ -391,7 +390,12 @@ class HttpClient
|
|||||||
private function generate_client($host, $url, $data)
|
private function generate_client($host, $url, $data)
|
||||||
{
|
{
|
||||||
$client = new SClient($host, $this->getHostPort(), $this->isSSL);
|
$client = new SClient($host, $this->getHostPort(), $this->isSSL);
|
||||||
var_dump($host, $this->getHostPort());
|
if (!empty($this->ssl_cert_file) && !empty($this->ssl_key_file)) {
|
||||||
|
$client->set([
|
||||||
|
'ssl_cert_file' => $this->ssl_cert_file,
|
||||||
|
'ssl_key_file' => $this->ssl_key_file,
|
||||||
|
]);
|
||||||
|
}
|
||||||
if (!empty($this->agent)) {
|
if (!empty($this->agent)) {
|
||||||
$this->header['User-Agent'] = $this->agent;
|
$this->header['User-Agent'] = $this->agent;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user