<?php

function getProxies($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec($ch);
    curl_close($ch);
    return explode("\n", $result);
}

$httpsProxies = getProxies('https://api.proxyscrape.com/?request=displayproxies&proxytype=https&timeout=7000&country=ALL&anonymity=elite&ssl=no');
$httpProxies = getProxies('https://api.proxyscrape.com/?request=displayproxies&proxytype=http&timeout=7000&country=ALL&anonymity=elite&ssl=no');
$socks4Proxies = getProxies('https://www.proxy-list.download/api/v1/get?type=socks4');
$socks5Proxies = getProxies('https://www.proxy-list.download/api/v1/get?type=socks5');

file_put_contents('https.txt', implode("\n", $httpsProxies));
file_put_contents('http.txt', implode("\n", $httpProxies));
file_put_contents('socks4.txt', implode("\n", $socks4Proxies));
file_put_contents('socks5.txt', implode("\n", $socks5Proxies));

echo "All proxies successfully grabbed & saved\n";
?>

이 코드는 다음 기능을 수행합니다. 지정된 URL에서 프록시를 다운로드하고 이를 문자열로 분할하여 적절한 파일에 씁니다.

댓글 (0)

여기에는 아직 댓글이 없습니다. 첫 번째 댓글이 되실 수 있습니다!

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다


프록시 선택 및 구매

데이터센터 프록시

회전 프록시

UDP 프록시

전 세계 10,000명 이상의 고객이 신뢰함

대리 고객
대리 고객
대리 고객 flowch.ai
대리 고객
대리 고객
대리 고객