i've written a php script to test proxy servers, but when i run it
from the command line, it doesn't terminate. i have to hit Ctrl+C to
terminate it. so, any ideas as to what i'm doing wrong, and how i
could fix it? here's the code:
<?
$address = 'whatever';
$port = 80;
$proxy = fsockopen("tcp://$address", (int) $port, $errno, $errstr,
1)
or exit('Failed - Can Not Open Socket Connection');
stream_set_timeout($proxy,1);
fputs($proxy,"GET http://www.google.com/ HTTP/1.1\r\nHost:
www.google.com\r\n\r\n");
while (!feof($proxy))
print fgets($proxy);
fclose($proxy);
exit();
?>
i'm using PHP 4.3.9 on Windows XP.