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.

  1. user visits http://te.st/proxy.php?get=xyz

  2. proxy.php downloads xyz external-server

  3. 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");  

read parallelcurl curlopt_writefunction


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -