diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index e5a828a..314bf33 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -3,6 +3,7 @@ namespace wchat\common; use Exception; +use Swoole\Coroutine; use Swoole\Coroutine\Http\Client as SClient; use Swoole\Coroutine\System; use Swoole\Coroutine\Client; @@ -340,7 +341,7 @@ class HttpClient [$this->host, $this->port] = explode(':', $this->host); } - if (!$this->checkIsIp($this->host)) { + if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) { $this->host = System::gethostbyname($this->host); }