protected function createClientResponse($response) { $fp = fopen('php://temp', 'r+'); fwrite($fp, $response); fseek($fp, 0); $stream = new Stream($fp, $this->loop); return new StreamingClient($stream); }