|
<?php A página de destino para visitar $url = "http://httpbin.org/ip"; $urls = "https://httpbin.org/ip"; Servidores proxy define("PROXY_SERVER", "tcp://t.16yun.cn:31111"); Informações de identidade do túnel define("PROXY_USER", "16YUN123"); define("PROXY_PASS", "123456"); $proxyAuth = base64_encode(PROXY_USER . ":" . PROXY_PASS); Configurar o túnel proxy $tunnel = rand(1,10000); $headers = implode("\r\n", [ "Autorização Proxy: Basic {$proxyAuth}", "Túnel Proxy: ${túnel}", ]); $sniServer = parse_url($urls, PHP_URL_HOST); $options = [ "http" => [ "proxy" =>PROXY_SERVER, "cabeçalho" => $headers, "método" => "GET", 'request_fulluri' => verdade, ], 'ssl' => array( 'SNI_enabled' => verdadeiro, // Desative SNI para https sobre proxies http 'SNI_server_name' => $sniServer ) ]; impressão ($url); $context = stream_context_create($options); $result = file_get_contents($url, falso, $context); var_dump($result); Visite a página HTTPS impressão ($urls); $context = stream_context_create($options); $result = file_get_contents($urls, falso, $context); var_dump($result); ?>
|