Example #1
0
    //lapin:jambon@192.168.1.2:3128
    require_once URLLOCAL . 'classes_ext/proxy.class.php';
    $tabMatch = array();
    if (preg_match('/([^:]+):([^@]+)@([^:]+):([^:]+)/', PROXY, $tabMatch)) {
        $user = $tabMatch[1];
        $pass = $tabMatch[2];
        $host = $tabMatch[3];
        $port = $tabMatch[4];
        HttpProxyStream::$proxy_host = $host;
        HttpProxyStream::$proxy_port = $port;
        HttpProxyStream::$proxy_user = $user;
        HttpProxyStream::$proxy_pass = $pass;
    } else {
        list($host, $port) = explode(':', PROXY);
        HttpProxyStream::$proxy_host = $host;
        HttpProxyStream::$proxy_port = $port;
    }
    define('PROTO', 'proxy://');
} else {
    define('PROTO', 'http://');
}
$stopAffichage = '';
//affichage d'un tableau en récursif
function affTab($tab)
{
    reset($tab);
    //$contenu = "<table align=\"center\" border =1><tr bgcolor=\"Silver\"><th>Index</th><th>Valeur</th></tr>" ;
    $contenu = "<table>";
    while (list($key, $val) = each($tab)) {
        if (is_array($val)) {
            $contenu .= "<tr><td><i>tab</i>[" . $key . "]</td><td>" . affTab($val) . "</td></tr>";
Example #2
0
<?php

// LOAD LIB
require_once 'proxy.class.php';
// CONFIGURE
HttpProxyStream::$proxy_host = 'your_proxy';
HttpProxyStream::$proxy_port = 8080;
HttpProxyStream::$proxy_user = '******';
HttpProxyStream::$proxy_pass = '******';
// OPEN NORMALY A URL
$f = fopen('proxy://www.google.fr', 'r');
while (!feof($f)) {
    echo fread($f, 4096);
}
fclose($f);
// OR WITH A FUNCTION
readfile('proxy://www.google.fr');
echo file_get_contents('proxy://www.google.fr');