|
<?php Stránka destinace k návštěvě $url = "http://httpbin.org/ip"; $urls = "https://httpbin.org/ip"; Proxy servery define("PROXY_SERVER", "tcp://t.16yun.cn:31111"); Informace o identitě tunelu define("PROXY_USER", "16YUN123"); define("PROXY_PASS", "123456"); $proxyAuth = base64_encode(PROXY_USER . ":" . PROXY_PASS); Nastavte proxy tunel $tunnel = rand(1 10000); $headers = implodovat ("\r\n", [ "Proxy-autorizace: Základní {$proxyAuth}", "Proxy-tunel: ${tunnel}", ]); $sniServer = parse_url($urls, PHP_URL_HOST); $options = [ "http" => [ "proxy" =>PROXY_SERVER, "header" => $headers, "metoda" => "DOSTAŇ", 'request_fulluri' => pravda, ], 'ssl' => pole( 'SNI_enabled' => pravda, // Vypnout SNI pro https přes http proxy 'SNI_server_name' => $sniServer ) ]; print($url); $context = stream_context_create($options); $result = file_get_contents($url, nepravdivé, $context); var_dump($result); Navštivte stránku HTTPS print($urls); $context = stream_context_create($options); $result = file_get_contents($urls, nepravdivé, $context); var_dump($result); ?>
|