<?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);
?>

Mengganti 'Proxy_IP_Address' Dan 'Proxy_Port' dengan alamat IP sebenarnya dan port proxy yang ingin Anda uji. Skrip ini mengirimkan permintaan ke URL tertentu melalui proxy dan memeriksa apakah kode responsnya 200 OK. Jika ada error atau kode responnya berbeda 200, ini menunjukkan bahwa proxy mungkin tidak berfungsi dengan benar.

Komentar (0)

Belum ada komentar di sini, Anda bisa menjadi yang pertama!

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *


Pilih dan Beli Proxy

Proksi Pusat Data

Memutar Proxy

Proksi UDP

Dipercaya Oleh 10.000+ Pelanggan di Seluruh Dunia

Pelanggan Proksi
Pelanggan Proksi
Pelanggan Proksi flowch.ai
Pelanggan Proksi
Pelanggan Proksi
Pelanggan Proksi