PHP fsockopen() php proxy check

 $host = '172.106.19.157';

$port = '57367'; 
$waitTimeoutInSeconds = 5;

sleep(1);

try {
if(fsockopen($host,$port,$errCode,$errStr, $waitTimeoutInSeconds)){

return "It worked $errCode";
}else{
throw new Exception('gggggggg');
}
} catch ( Exception $e) {
return "It didn't work ";
}

--------------------
// $host = '172.106.19.157';
// $port = '57367';
$proxy5 = "172.106.19.157:11111";
$host = substr($proxy5, 0,-6);
$port = substr($proxy5, -5);

return = 172.106.19.157:11111


 

Post a Comment

Previous Post Next Post