Добрый день.
У меня та же проблема. Пытаюсь выполнить тестовый запрос, а в ответ пустой body. При этом, если судить по дампу PHPDaemon\Clients\HTTP\Connection DNS работает нормально, адрес разыменован.
class WebSocket extends \PHPDaemon\Core\AppInstance {
/**
* @var \PHPDaemon\Clients\HTTP\Pool
*/
public $httpclient;
public function onReady() {
$this->httpclient = \PHPDaemon\Clients\HTTP\Pool::getInstance();
$this->httpclient->get('
http://www.rambler.ru',
function ($conn, $success) {
\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::dump('HTTP client'));
\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::dump($conn));
\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::dump($conn->body));
\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::dump($success));
// $this->finish();
}
);
}
Результат в логе:
[Thu, 28 May 2015 10:54:53.612022 +0000] string(11) "HTTP client"
[Thu, 28 May 2015 10:54:53.616486 +0000] class PHPDaemon\Clients\HTTP\Connection#137 (68) {
public $headers =>
array(2) {
'STATUS' =>
string(20) "Host:
www.rambler.ru"
'HTTP_USER_AGENT' =>
string(19) "phpDaemon/1.0-beta3"
}
public $contentLength =>
int(-1)
public $body =>
string(0) ""
protected $EOL =>
string(2) "
"
public $cookie =>
array(0) {
}
public $curChunkSize =>
NULL
public $curChunk =>
NULL
public $chunked =>
bool(false)
public $protocolError =>
NULL
public $responseCode =>
int(0)
public $lastURL =>
NULL
public $rawHeaders =>
NULL
protected $busy =>
bool(true)
protected $timeout =>
int(60)
protected $noSAF =>
bool(true)
protected $onResponse =>
class PHPDaemon\Structures\StackCallbacks#139 (2) {
private $flags =>
int(6)
private $dllist =>
array(0) {
}
}
protected $maxQueue =>
int(1)
protected $path =>
NULL
protected $host =>
string(14) "
www.rambler.ru"
protected $hostReal =>
string(10) "81.19.70.1"
protected $port =>
int(80)
protected $user =>
NULL
protected $password =>
NULL
protected $addr =>
string(13) "
81.19.70.1:80"
protected $onConnected =>
NULL
protected $connected =>
bool(true)
protected $failed =>
bool(false)
protected $locAddr =>
NULL
protected $locPort =>
NULL
protected $keepalive =>
bool(false)
protected $type =>
string(3) "tcp"
protected $parentSocket =>
NULL
protected $dgram =>
bool(false)
protected $bevConnectEnabled =>
bool(true)
protected $uri =>
array(5) {
'scheme' =>
string(3) "tcp"
'host' =>
string(14) "
www.rambler.ru"
'uri' =>
string(20) "tcp://
www.rambler.ru"
'params' =>
array(0) {
}
'port' =>
int(80)
}
protected $scheme =>
string(3) "tcp"
protected $pkfile =>
NULL
protected $certfile =>
NULL
protected $passphrase =>
NULL
protected $verifypeer =>
bool(false)
protected $allowselfsigned =>
bool(true)
public $pool =>
class PHPDaemon\Clients\HTTP\Pool#67 (18) {
protected $servers =>
array(0) {
}
protected $dtags_enabled =>
bool(false)
protected $servConn =>
array(1) {
'tcp://
www.rambler.ru' =>
class PHPDaemon\Structures\ObjectStorage#54 (1) {
...
}
}
protected $servConnFree =>
array(1) {
'tcp://
www.rambler.ru' =>
class PHPDaemon\Structures\ObjectStorage#55 (1) {
...
}
}
protected $prefix =>
string(0) ""
protected $maxConnPerServ =>
int(32)
protected $acquireOnGet =>
bool(false)
protected $pending =>
array(0) {
}
public $connectionClass =>
string(34) "\PHPDaemon\Clients\HTTP\Connection"
public $name =>
string(0) ""
public $config =>
class PHPDaemon\Config\Section#66 (5) {
public $source =>
NULL
public $revision =>
NULL
public $port =>
class PHPDaemon\Config\Entry\Generic#68 (8) {
...
}
public $sslport =>
class PHPDaemon\Config\Entry\Generic#69 (8) {
...
}
public $expose =>
class PHPDaemon\Config\Entry\Generic#51 (8) {
...
}
}
public $maxConcurrency =>
int(0)
public $maxAllowedPacket =>
int(0)
protected $finished =>
bool(false)
protected $enabled =>
bool(true)
protected $overload =>
bool(false)
public $appInstance =>
NULL
private $storage =>
array(1) {
'000000006429d8c2000000007b7a6482' =>
array(2) {
...
}
}
}
protected $EOLS =>
int(1)
protected $bev =>
class EventBufferEvent#156 (4) {
public $priority =>
NULL
public $fd =>
int(13)
public $input =>
class EventBuffer#140 (2) {
public $length =>
int(172)
public $contiguous_space =>
int(172)
}
public $output =>
class EventBuffer#153 (2) {
public $length =>
int(0)
public $contiguous_space =>
int(0)
}
}
protected $fd =>
NULL
protected $finished =>
bool(true)
protected $ready =>
bool(true)
protected $writing =>
bool(false)
protected $lowMark =>
int(1)
protected $highMark =>
int(0)
protected $priority =>
NULL
protected $inited =>
bool(true)
protected $state =>
int(2)
protected $onWriteOnce =>
class PHPDaemon\Structures\StackCallbacks#138 (2) {
private $flags =>
int(6)
private $dllist =>
array(0) {
}
}
protected $url =>
string(20) "tcp://
www.rambler.ru"
protected $alive =>
bool(true)
protected $bevConnect =>
bool(true)
protected $wRead =>
bool(false)
protected $freed =>
bool(false)
protected $ctx =>
NULL
protected $ctxname =>
NULL
protected $ctxMode =>
NULL
protected $ssl =>
bool(false)
protected $timeoutRead =>
int(60)
protected $timeoutWrite =>
int(60)
protected $eventHandlers =>
array(0) {
}
protected $addThisToEvents =>
bool(true)
protected $lastEventName =>
NULL
}
[Thu, 28 May 2015 10:54:53.616725 +0000] string(0) ""
[Thu, 28 May 2015 10:54:53.616904 +0000] bool(true)