|
<?php La pagina delle destinazioni da visitare $url = "http://httpbin.org/ip"; $urls = "https://httpbin.org/ip"; Server proxy definire("PROXY_SERVER", "tcp://t.16yun.cn:31111"); Informazioni sull'identità del tunnel define("PROXY_USER", "16YUN123"); definire("PROXY_PASS", "123456"); $proxyAuth = base64_encode(PROXY_USER . ":" . PROXY_PASS); Impostare il tunnel proxy $tunnel = rand(1,10000); $headers = implode("\r\n", [ "Autorizzazione Proxy: Basic {$proxyAuth}", "Tunnel Proxy: ${tunnel}", ]); $sniServer = parse_url($urls, PHP_URL_HOST); $options = [ "http" => [ "proxy" =>PROXY_SERVER, "header" => $headers, "metodo" => "GET", 'request_fulluri' => vero, ], 'ssl' => array( 'SNI_enabled' => true, // Disabilita SNI per https sui proxy http 'SNI_server_name' => $sniServer ) ]; stampa ($url); $context = stream_context_create($options); $result = file_get_contents($url, falso, $context); var_dump($result); Visita la pagina HTTPS stampa ($urls); $context = stream_context_create($options); $result = file_get_contents($urls, falso, $context); var_dump($result); ?>
|