PDA

Просмотр полной версии : Открытие сокета через прокси в пхп.


mr.The
01.05.2007, 16:24
Как открыть сокет через прокси?
Например в таком коде:

<?php
$site="site.com";
$mesto="index.htm";
$so = fsockopen($site,80); fputs($so,"GET /".$mesto." HTTP/1.0\nHOST: ".$site."\n\n");
fclose($so);
?>


помогите плз :confused:

Isis
01.05.2007, 17:27
<?php
$site="site.com";
$mesto="index.htm";
$fp = @fsockopen($proxyhost, $proxyport, $errno, $errstr, 5);
if(!$fp) {
echo "$errstr ($errno)<br>";
} else {
$out = "GET /".$mesto." HTTP/1.0\r\n";
$out .= "Host: $site\r\n";
$out .= "Connection: Close\r\n";
$out .= "\r\n";
fwrite($fp,$out);
fclose($fp);
}
?>

_Great_
01.05.2007, 17:51
https://forum.antichat.ru/thread38811.html
closed