Zend_Http_Client requests do not work with Fiddler proxy

I wrote a simple spider to test various things with Fiddler. The script executes multiple requests using Zend_Http_Client-> request () using the same instance of the Zend_Http_Client class ($ client in the example below).

When using Fiddler and Zend_Http_Client, only the first Zend_Http_Client-> request () works; subsequent requests fail with "Unable to read response or response is empty." Here is my Zend_Http_Client configuration with Fiddler:

$config = array(
    'adapter'       => 'Zend_Http_Client_Adapter_Proxy',
    'proxy_host'    => '127.0.0.1',
    'proxy_port'    => 8888,
    'timeout'       => 60,
    'useragent'     => 'Local Site Spider Test',
    'keepalive'     => true,
    'sslusecontext' => true
);

$client = new Zend_Http_Client('http://www.site.com/',  $config);

Here's a simplified example of what failed using $ client from above:

$response = $client->request();
echo $response->getHeadersAsString();

$client->setUri('http://www.site.com/file.html');
$response = $client->request();
echo $response->getHeadersAsString();

100%, -, . Fiddler , ( WinInet, ).

+3

Source: https://habr.com/ru/post/1793692/


All Articles