PHP different ips' same proxy check takes too long
<p>I read the post here
<a href="http://stackoverflow.com/questions/2226374/test-if-port-open-and-forwarded-using-php">Test if port open and forwarded using PHP</a></p>

<p>about 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</p>

<pre><code>for($i=0;$i&lt;2;$i++){
$host = 'xxx.xxx.xxx.'.$i;
  $connection = @fsockopen($host, 3128);

if (is_resource($connection))
{
    echo '&lt;h2&gt;' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.&lt;/h2&gt;' . "\n";

    fclose($connection);
}

else
{
    echo '&lt;h2&gt;' . $host . ':' . $port . ' is not responding.&lt;/h2&gt;' . "\n";
}
</code></pre>

<p>}</p>
