|
<?php 방문할 목적지 페이지 $url = "http://httpbin.org/ip"; $urls = "https://httpbin.org/ip"; 프록시 서버 define("PROXY_SERVER", "tcp://t.16yun.cn:31111"); 터널 식별 정보 define("PROXY_USER", "16YUN123"); define("PROXY_PASS", "123456"); $proxyAuth = base64_encode(PROXY_USER. ":" . PROXY_PASS); 프록시 터널을 설정하세요 $tunnel = 랜드(1,10000); $headers = 내파("\r\n", [ "프록시 권한: 기본 {$proxyAuth}", "프록시 터널: ${터널}", ]); $sniServer = parse_url($urls, PHP_URL_HOST); $options = [ "http" => [ "프록시" =>PROXY_SERVER, "헤더" => $headers, "method" => "GET", 'request_fulluri' => 사실이다, ], 'ssl' => 배열( 'SNI_enabled' => true, // http 프록시를 통한 https SNI를 비활성화하세요 'SNI_server_name' => $sniServer ) ]; 인쇄물($url); $context = stream_context_create($options); $result = file_get_contents($url, 거짓, $context); var_dump($result); HTTPS 페이지를 방문하세요 인쇄물($urls); $context = stream_context_create($options); $result = file_get_contents($urls, 거짓, $context); var_dump($result); ?>
|