add clear

This commit is contained in:
2020-03-31 15:06:15 +08:00
parent 5d510cadb6
commit e9c21d404a
+6 -2
View File
@@ -337,7 +337,6 @@ class HttpClient
*/
private function coroutine($ip, $url, $data = [])
{
echo $ip . ':' . $url . PHP_EOL;
$client = $this->generate_client($ip, $url, $data);
if ($client->statusCode < 0) {
throw new \Exception($client->errMsg);
@@ -391,7 +390,12 @@ class HttpClient
private function generate_client($host, $url, $data)
{
$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)) {
$this->header['User-Agent'] = $this->agent;
}