Answer the question
In order to leave comments, you need to log in
Curl Multi socks5 proxy gives an error after the first troubles, why is it normal with http?
Windows 8
Apache 2.4
Php version 7
Curl version 7.50
I load http proxy 10 - 15k, I put any streams at least 1k checks quickly without errors, with socks5 another situation up to 200 pieces also checks perfectly, but after 200 or more, regardless of the number of streams, it issues error:
$multith = curl_multi_init();
foreach($proxys as $ip) {
for($i=0; $i<count($ip); $i++) {
$ch[$i] = curl_init();
curl_setopt($ch[$i], CURLOPT_URL, $url);
curl_setopt($ch[$i], CURLOPT_HEADER, true);
curl_setopt($ch[$i], CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch[$i], CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch[$i], CURLOPT_AUTOREFERER, true);
curl_setopt($ch[$i], CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch[$i], CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch[$i], CURLOPT_PROXY, $ip[$i]);
curl_setopt($ch[$i], CURLOPT_VERBOSE, true);
curl_setopt($ch[$i], CURLOPT_STDERR, $files);
curl_setopt($ch[$i], CURLOPT_PROXYTYPE, type($proxytype));
curl_setopt($ch[$i], CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch[$i], CURLOPT_NOBODY, true);
curl_setopt($ch[$i], CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch[$i], CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch[$i], CURLOPT_FAILONERROR, true);
curl_setopt($ch[$i], CURLOPT_POST, true);
#curl_setopt($ch[$i], CURLOPT_PROXYUSERPWD, "login:pass");
curl_multi_add_handle($multith,$ch[$i]);
}
do {
while($send = curl_multi_exec($multith,$run));
} while($run == CURLM_CALL_MULTI_PERFORM);
usleep(5000);
while($run && $send == CURLM_OK) {
if(curl_multi_select($multith) != -1) {
do {
$send = curl_multi_exec($multith,$run);
while($result = curl_multi_info_read($multith)) {
if($result['msg'] == CURLMSG_DONE) {
$getinfo = curl_getinfo($result['handle']);
$check = $getinfo['http_code'];
if($check != 0) {
$count++;
echo $ip[array_search($result['handle'],$ch)].PHP_EOL;
flush();
ob_flush();
$ips = $ip[array_search($result['handle'],$ch)]."\r\n";
proxy_save(_FILE,$ips);
curl_multi_remove_handle($multith,$result['handle']);
}
}
}
usleep(100);
} while($run == CURLM_CALL_MULTI_PERFORM);
usleep(100);
}
}
}
Answer the question
In order to leave comments, you need to log in
just try to reduce version
https://curl.haxx.se/mail/tracker-2010-07/0061.html
CURLOPT_HTTPPROXYTUNNEL this option only applies to http proxies, I don't know if this will help solve the problem, but you can try
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question