Re: Testing Response of A Proxy with PHP?
| From: | Nick Wilson | Date: | Tue, 28 Sep 2004 12:18:28 +0000 |
| Subject: | Re: Testing Response of A Proxy with PHP? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198059@lists.php.net to get a copy of this message | ||
* and then Marek Kilimajer declared....
> >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
Well, it connects great! However, i get errors back about * being a bad
url...?
--
Nick W