2

I would like to make some simultaneous requests with curl_multi_init using proxies but I don't know how to check in a request if the proxy is banned and then change the proxy and restart the request.

Thank you

My code :

<?php
$thread = [];

for($i = 0; $i < 50; $i++)
{
    $thread[$i] = curl_init('https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending');
    curl_setopt($thread[$i], CURLOPT_HEADER, 0);
    curl_setopt($thread[$i],CURLOPT_SSL_VERIFYPEER,false);    
}

$mh = curl_multi_init();

for($i = 0; $i < 50; $i++)
{
    curl_multi_add_handle($mh,$thread[$i]);
}

do {
    $status = curl_multi_exec($mh, $active);
    if ($active) {
        curl_multi_select($mh);  
    }
} while ($active && $status == CURLM_OK);
curl_multi_close($mh);
?>

Errorj404
  • 43
  • 8

0 Answers0