<?php

// Set the proxy IP address and port
$proxyIP = 'Proxy_IP_Address';
$proxyPort = 'Proxy_Port';

// URL to test the proxy
$url = 'http://example.com';

// Set timeout for the request
$timeout = 10;

// Initialize cURL session
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxyIP . ':' . $proxyPort);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

// Execute cURL request
$response = curl_exec($ch);

// Check if any error occurred
if(curl_errno($ch)) {
    echo 'Error: ' . curl_error($ch);
} else {
    // Get HTTP response code
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    
    // Check if request was successful (HTTP 200)
    if($httpCode == 200) {
        echo 'Proxy is working!';
    } else {
        echo 'Proxy is not working. HTTP Response Code: ' . $httpCode;
    }
}

// Close cURL session
curl_close($ch);
?>

Değiştirin 'Proxy_IP_Address' ve 'Proxy_Port' test etmek istediğiniz proxy'nin gerçek IP adresi ve bağlantı noktasıyla. Bu komut dosyası, proxy aracılığıyla belirtilen bir URL'ye bir istek gönderir ve yanıt kodunun olup olmadığını kontrol eder. 200 OK. Herhangi bir hata varsa veya yanıt kodu şundan farklıysa: 200, proxy'nin düzgün çalışmayabileceğini gösterir.

Yorumlar (0)

Burada henüz yorum yok, ilk siz olabilirsiniz!

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


Proxy Seçin ve Satın Alın

Veri Merkezi Proxyleri

Dönen Proxyler

UDP Proxyleri

Dünya Çapında 10.000'den Fazla Müşterinin Güvendiği

Vekil Müşteri
Vekil Müşteri
Vekil Müşteri flowch.ai
Vekil Müşteri
Vekil Müşteri
Vekil Müşteri