|
<?php La página de destinos para visitar $url = "http://httpbin.org/ip"; $urls = "https://httpbin.org/ip"; Servidores proxy define("PROXY_SERVER", "tcp://t.16yun.cn:31111"); Información de identidad del túnel define("PROXY_USER", "16YUN123"); define("PROXY_PASS", "123456"); $proxyAuth = base64_encode(PROXY_USER . ":" . PROXY_PASS); Configurar el túnel proxy $tunnel = rand(1,10000); $headers = implosionar("\r\n", [ "Autorización Proxy: Basic {$proxyAuth}", "Túnel Proxy: ${túnel}", ]); $sniServer = parse_url($urls, PHP_URL_HOST); $options = [ "http" => [ "proxy" =>PROXY_SERVER, "encabezado" => $headers, "método" => "GET", 'request_fulluri' => cierto, ], 'ssl' => array( 'SNI_enabled' => true, // Desactiva SNI para https sobre proxies http 'SNI_server_name' => $sniServer ) ]; impreso ($url); $context = stream_context_create($options); $result = file_get_contents($url, falso, $context); var_dump($result); Visita la página de HTTPS impresos ($urls); $context = stream_context_create($options); $result = file_get_contents($urls, falso, $context); var_dump($result); ?>
|