|
<?php Cieľová stránka na návštevu $url = "http://httpbin.org/ip"; $urls = "https://httpbin.org/ip"; Proxy servery define("PROXY_SERVER", "tcp://t.16yun.cn:31111"); Informácie o identite tunela define("PROXY_USER", "16YUN123"); define("PROXY_PASS", "123456"); $proxyAuth = base64_encode(PROXY_USER . ":" . PROXY_PASS); Nastavte proxy tunel $tunnel = rand(1 10000); $headers = implodovať ("\r\n", [ "Proxy-autorizácia: Basic {$proxyAuth}", "Proxy-tunel: ${tunnel}", ]); $sniServer = parse_url($urls, PHP_URL_HOST); $options = [ "http" => [ "proxy" =>PROXY_SERVER, "header" => $headers, "metóda" => "DOSTAŤ", 'request_fulluri' => pravda, ], 'ssl' => pole( 'SNI_enabled' => true, // Vypnúť SNI pre https cez http proxy 'SNI_server_name' => $sniServer ) ]; print($url); $context = stream_context_create($options); $result = file_get_contents($url, nepravda, $context); var_dump($result); Navštívte stránku HTTPS print($urls); $context = stream_context_create($options); $result = file_get_contents($urls, nepravdivé, $context); var_dump($result); ?>
|