1
This commit is contained in:
+3
-3
@@ -82,12 +82,12 @@ class AsyncClient extends ClientAbstracts
|
|||||||
private function generate_client($data, $host, $isHttps, $path): void
|
private function generate_client($data, $host, $isHttps, $path): void
|
||||||
{
|
{
|
||||||
$this->client = new SwowClient(SWOOLE_TCP, FALSE);
|
$this->client = new SwowClient(SWOOLE_TCP, FALSE);
|
||||||
if ($isHttps || $this->isSSL()) {
|
|
||||||
$this->client->enableSSL();
|
|
||||||
}
|
|
||||||
if (!$this->client->connect($host, $this->getPort())) {
|
if (!$this->client->connect($host, $this->getPort())) {
|
||||||
throw new Exception('链接失败');
|
throw new Exception('链接失败');
|
||||||
}
|
}
|
||||||
|
if ($isHttps || $this->isSSL()) {
|
||||||
|
$this->client->enableSSL();
|
||||||
|
}
|
||||||
$this->client->set($this->settings());
|
$this->client->set($this->settings());
|
||||||
if (!empty($this->getAgent())) {
|
if (!empty($this->getAgent())) {
|
||||||
$this->withAddedHeader('User-Agent', $this->getAgent());
|
$this->withAddedHeader('User-Agent', $this->getAgent());
|
||||||
|
|||||||
Reference in New Issue
Block a user