Advertisement
Guest User

proxy checker

a guest
Dec 11th, 2022
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <?php
  2.  
  3. $ip = file_get_contents("list.txt");
  4. $ip2 = explode("\r\n", $ip);
  5. foreach ($ip2 as $key => $value) {
  6. $data = explode(":", $value);
  7. $proxy = $data[0];
  8. $port = $data[1];
  9.  
  10. $ch = curl_init();
  11. curl_setopt($ch, CURLOPT_URL, "http://ip-api.com/json/".$proxy."");
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  13. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  14. $gege = curl_exec($ch);
  15. curl_close($ch);
  16.  
  17. $gege1 = json_decode($gege, true);
  18. $negara = $gege1['country'];
  19. $isp = $gege1['isp'];
  20.  
  21.  
  22. $curl = curl_init();
  23. curl_setopt($curl, CURLOPT_URL, "https://proxy-checker.net/api/proxy-checker/");
  24. curl_setopt($curl, CURLOPT_POST, true);
  25. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  26.  
  27. $headers = [
  28. "Accept: */*",
  29. "Accept-Language: en-US,en;q=0.9",
  30. "Connection: keep-alive",
  31. "Content-Type: application/x-www-form-urlencoded; charset=UTF-8",
  32. "Origin: https://proxyline.net",
  33. "Referer: https://proxyline.net/",
  34. "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36",
  35. ];
  36. curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  37.  
  38. $data1 = "proxy_list=" . $proxy . "%3A" . $port . "";
  39.  
  40. curl_setopt($curl, CURLOPT_POSTFIELDS, $data1);
  41.  
  42. $resp = curl_exec($curl);
  43. curl_close($curl);
  44. //var_dump($resp);
  45. $hasil = json_decode($resp, true);
  46. foreach ($hasil as $key => $value) {
  47. if ($value["valid"] == true) {
  48. if ($value["data"]["connection_time"] < 3) {
  49. $untukcheck = $value["ip"] . ":" . $value["port"] . " - ".$negara." - ".$isp." | Response Time : " . $value["data"]["connection_time"] . "\r\n";
  50. echo "CEPAT : " . $value["ip"] . ":" . $value["port"] . " | " . $value["protocol"] . " | Anonimity : " . $value["data"]["anonymity_level"] . " - ".$negara." - ".$isp." | Response Time : " . $value["data"]["connection_time"] . " second | LIVE! \r\n";
  51. $save = fopen("live-proxy.txt", "a+");
  52. fwrite($save, $untukcheck);
  53. fclose($save);
  54. } else {
  55. echo "LELET : " . $value["ip"] . ":" . $value["port"] . " | " . $value["protocol"] . " | " . $value["data"]["anonymity_level"] . " | " . $value["data"]["connection_time"] . " LIVE! \r\n";
  56. $save = fopen("lambat-proxy.txt", "a+");
  57. fwrite($save, $untukcheck);
  58. fclose($save);
  59. }
  60. } elseif ($value["valid"] == false) {
  61. echo "IP : " . $value["ip"] . ":" . $value["port"] . " DEAD! \r\n";
  62. }
  63. }
  64. }
  65.  
  66. ?>
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement