Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-28 Thread Nick Wilson

* 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Nick Wilson
hi again all, 

I cant find any functions that might help me test the response of a
proxy server b4 attempting to use it. Do i need to use exec() with ping?

Anyone know how to do that? (if that's the case...)

mucho grassy arse..
-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Marek Kilimajer
Nick Wilson wrote:
hi again all, 

I cant find any functions that might help me test the response of a
proxy server b4 attempting to use it. Do i need to use exec() with ping?
Anyone know how to do that? (if that's the case...)
mucho grassy arse..
What kind of response? If the server is alive, if the proxy is alive? If 
an url exists?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Nick Wilson

* and then Marek Kilimajer declared
 I cant find any functions that might help me test the response of a
 proxy server b4 attempting to use it. Do i need to use exec() with ping?
 
 Anyone know how to do that? (if that's the case...)
 
 What kind of response? If the server is alive, if the proxy is alive? If 
 an url exists?

hehe, good point! Just if the server is alive i guess. I want to use the
proxy and want to test if it's responsive b4 i attempt to use it...


-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Marek Kilimajer
Nick Wilson wrote:
* and then Marek Kilimajer declared
I cant find any functions that might help me test the response of a
proxy server b4 attempting to use it. Do i need to use exec() with ping?
Anyone know how to do that? (if that's the case...)
What kind of response? If the server is alive, if the proxy is alive? If 
an url exists?

hehe, good point! Just if the server is alive i guess. I want to use the
proxy and want to test if it's responsive b4 i attempt to use it...
OPTIONS * HTTP/1.0
More at http://www.freesoft.org/CIE/RFC/2068/63.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Nick Wilson

* 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
and what would be the difference in that and just pinging the server to
see if it's responding?

Thanks for the help..

-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Marek Kilimajer
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Testing Response of A Proxy with PHP?

2004-09-26 Thread Nick Wilson

* 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);
 }

Okay, thanks marek, i can take it from there ;-)
Im tired, its past my bedtime, i'll check the manual in the morning and
work on your code. Thanks very, very much!

 Even if the server is up that does not mean proxy is working.

Yep, i get it. THanks..

-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php