PHP: curl and stream forwarding -
curl has lots of options make easier use-case request data server. script similar proxy , far requesting data server , once result data complete, it's send client @ once.
user visits http://te.st/proxy.php?get=xyz
proxy.php downloads xyz external-server
when download completed 100%, output data
now wonder whether 2 , 3 can done in parallel (with php5-curl), "proxy stream" forwards data on fly without waiting last line.
if file size 20mb in average, makes significant difference.
is there option in curl?
take @ http://www.php.net/manual/en/function.curl-setopt.php#26239
something (not tested):
function myprogressfunc($ch, $str){ echo $str; return strlen($str); } curl_setopt($ch, curlopt_writefunction, "myprogressfunc");
Comments
Post a Comment