swoole 文件下载 域名问题

WARNING swClient_inet_addr: DNS lookup will block the process. Please use swoole_async_dns_lookup. 因为用的是域名,所以一直报这个错误。 用了swoole_async_dns_lookup 函数 依然报上述错误

    $host =  "1252020456.vod2.myqcloud.com";
    swoole_async_dns_lookup($host, function($host, $ip){

        $cli = new \swoole_http_client($host, 80);
        $cli->setHeaders([
            'Host' => $ip,
            "User-Agent" => 'Chrome/49.0.2587.3',
            'Accept' => '*',
            'Accept-Encoding' => 'gzip',
        ]);
        $cli->download('/d791157avodgzp1252020456/96fac6cb7447398155573221607/f0.mp4', '/home/wwwroot/default/test/public/yu_'.time().'.mp4',  function ($cli) {
            var_dump($cli);
        });
   });
2018-04-30 18:49
0

要回复问题请先登录注册