Открытие сокета через прокси в пхп.

Discussion in 'PHP' started by mr.The, 1 May 2007.

Thread Status:
Not open for further replies.
  1. mr.The

    mr.The Elder - Старейшина

    Joined:
    30 Apr 2007
    Messages:
    1,080
    Likes Received:
    456
    Reputations:
    38
    Как открыть сокет через прокси?
    Например в таком коде:
    PHP:
    <?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:
     
  2. banned

    banned Banned

    Joined:
    20 Nov 2006
    Messages:
    3,324
    Likes Received:
    1,194
    Reputations:
    252
    PHP:
    <?php
    $site
    ="site.com";
    $mesto="index.htm"
    $fp = @fsockopen($proxyhost$proxyport$errno$errstr5);
                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);
                             }
    ?>
     
  3. _Great_

    _Great_ Elder - Старейшина

    Joined:
    27 Dec 2005
    Messages:
    2,032
    Likes Received:
    1,118
    Reputations:
    1,139
    /thread38811.html
    closed
     
Thread Status:
Not open for further replies.