PHP different ips' same proxy check takes too long

joshuar

New Member
I read the post hereTest if port open and forwarded using PHPabout how to scan ports of the same proxy . But my problem is I want to do scan the same port of different ip xxx.xxx.xxx.$i and for loop i try to run it from 0 to 255 . I use the same script in the above mentioned post using for loop . But it takes too long to get the answer (actually I dont get any) . Here is the code\[code\]for($i=0;$i<2;$i++){$host = 'xxx.xxx.xxx.'.$i; $connection = @fsockopen($host, 3128);if (is_resource($connection)){ echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n"; fclose($connection);}else{ echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";}\[/code\]}
 
Back
Top