Why a Guzzle Body Stream Can Still Be Buffered
The body interface, transport delivery and your own parser can buffer independently. Use stream explicitly and keep consumption incremental.
getBody() returns a stream interface even when Guzzle has already downloaded the response. To request incremental network delivery through a forward proxy, set stream on the request:
$response = $client->request('GET', 'https://example.com/stream', [
'proxy' => 'http://proxy.example:8080',
'stream' => true,
'read_timeout' => 10,
]);
$body = $response->getBody();
This uses an existing client; for a public HTTP endpoint, pick an address from the HTTP proxy list and replace the example proxy URL. Streaming support depends on its handler; the stream interface alone cannot tell you whether the handler delivered the body incrementally.
Once the response arrives, keep reading bounded portions. Converting $body to a string gathers the whole body again. A line parser can also appear to hang while waiting for a newline, even though network bytes have arrived. These are consumption delays, so changing the proxy will not remove them.
read_timeout limits individual read waits under the supported stream implementation. It does not give an endless feed a ten-second total lifetime. Handle timeout, EOF and errors separately, and close the body when processing ends or is cancelled.