Re: Testing Response of A Proxy with PHP?

From: Date: Sun, 26 Sep 2004 20:47:45 +0000
Subject: Re: Testing Response of A Proxy with PHP?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-197905@lists.php.net to get a copy of this message
Nick Wilson wrote:
* and then Marek Kilimajer declared....
OPTIONS * HTTP/1.0 More at http://www.freesoft.org/CIE/RFC/2068/63.htm
oookay... i think i understand the page, but how would i imlement that
$fp = fsockopen ("proxy.server.net", 8080, $errno, $errstr, 30); if (!$fp) {
    echo "$errstr ($errno)<br>\n";
} else {
    fputs ($fp, "OPTIONS * HTTP/1.0\r\nMax-Forwards: 0\r\n\r\n");
    while (!feof($fp)) {
        echo fgets ($fp,128);
    }
    fclose ($fp);
} You should get something like: HTTP/1.0 200 Ok Date: Sun, 26 Sep 2004 20:48:46 GMT Via: HTTP/1.1 proxy.server.net (Traffic-Server/4.0.18 [c s f ]) Allow: CONNECT, DELETE, GET, HEAD, OPTIONS, POST, PURGE, PUT, PUSH, TRACE Content-Length: 0
and what would be the difference in that and just pinging the server to see if it's responding?
Even if the server is up that does not mean proxy is working.

« previous php.general (#197905) next »