
Petar - 2007-10-27 09:26:11
Hi,
There is a detailed example test_html.php. I just want to ask you about minimal required part of this example to get only the body of given webpage via transparent proxy.
$http=new http_class;
$url="http://www.google.com/";
$error=$http->GetRequestArguments($url,$arguments);
$arguments["ProxyHostName"]=$ip;
$arguments["ProxyHostPort"]=$port;
$arguments["ProxyUser"]="";
$arguments["ProxyPassword"]="";
$arguments["ProxyRealm"]="";
$arguments["ProxyWorkstation"]="";
$http->proxy_authentication_mechanism="";
$arguments["Headers"]["Pragma"]="nocache";
$error=$http->Open($arguments);
$error=$http->SendRequest($arguments);
$error=$http->ReadReplyHeaders($headers);
for(;;) {
$error=$http->ReadReplyBody($body,1000);
if($error!="" || strlen($body)==0) break;
echo HtmlSpecialChars($body);
}
echo "</PRE>\n";
$http->Close();
Are there any missing or extra no-necessary parts?
----
$http->timeout=10;
$http->data_timeout=1;
What does this mean? 10 sec, or ...? What is the difference between timewout and data_timeout?