ZF2-444: Http\Client\Adapter\Socket not returning valid response


Socket is the default adapter for client, and is having issues / connecting to the majority of sites. The simple code below triggers an exception that returns an empty string and thus the exception is thrown on Response::fromString which is called by Socket. Strangely it can handle a connection to So, I'm guessing there's a header that's missing or conversely, is present and confusing it?

$this->httpClient = new Client; $this->httpClient->setUri(''); $response = $this->httpClient->send();


Socket::read is the method that's triggering Response::fromString causing the exception to occur. Maybe read should throw an exception itself?

Fixed in 2.0.0rc3