#!/usr/bin/perl -w
$^W = 336 >> 3;
use strict;
use LWP::UserAgent;
my $UA = new LWP::UserAgent;
$UA->proxy('http', 'http://proxy.ahcl.com:8080/');
HEAD('http://123box.co.uk/');
HEAD('http://japhy.perlmonk.org/book/');
real_HEAD('http://123box.co.uk/');
real_HEAD('http://japhy.perlmonk.org/book/');
sub HEAD {
my $req = HTTP::Request->new(GET => shift);
my $res = $UA->request($req, sub { }, 1);
print "HEAD\n\n", $res->as_string(), "\n";
}
sub real_HEAD {
my $req = HTTP::Request->new(HEAD => shift);
my $res = $UA->request($req);
print "real_HEAD\n\n", $res->as_string(), "\n";
}
__END__
HEAD
HTTP/1.1 200 OK
Connection: close
Date: Wed, 21 Nov 2001 12:27:24 GMT
Via: HTTP/1.1 (IBM-PROXY-WTE), 1.0 NSW-PROXY
Server: Apache/1.3.19 (Unix) mod_gzip/1.3.19.1a Resin/1.2.2
Content-Length: 8514
Content-Type: text/html
Content-Type: text/html;
Client-Date: Wed, 21 Nov 2001 12:33:16 GMT
Client-Peer: 10.1.17.5:8080
Title: login
HEAD
HTTP/1.1 200 OK
Connection: close
Date: Wed, 21 Nov 2001 12:18:07 GMT
Via: 1.1 NSW-PROXY
Age: 940
Server: Apache/1.3.22 (Unix) mod_perl/1.26 PHP/4.0.6
Content-Length: 1766
Content-Type: text/html
ETag: "57532-6e6-3bf6bcac"
Last-Modified: Sat, 17 Nov 2001 19:38:20 GMT
Client-Date: Wed, 21 Nov 2001 12:33:18 GMT
Client-Peer: 10.1.17.5:8080
Title: Regular Expressions in Perl
real_HEAD
HTTP/1.1 504 (Gateway Timeout) Proxy Error: Remote host did not send a
+ny data - URL "http://123box.co.uk/".
Cache-Control: no-cache
Connection: close
Date: Wed, 21 Nov 2001 12:36:20 GMT
Pragma: no-cache
Via: HTTP/1.1 (IBM-PROXY-WTE), 1.0 NSW-PROXY
Server: IBM-PROXY-WTE/3.0
Content-Type: text/html
Expires: Wed, 21 Nov 2001 12:36:20 GMT
Last-Modified: Wed, 21 Nov 2001 12:36:20 GMT
Client-Date: Wed, 21 Nov 2001 12:33:18 GMT
Client-Peer: 10.1.17.5:8080
real_HEAD
HTTP/1.1 200 OK
Connection: close
Date: Wed, 21 Nov 2001 12:43:15 GMT
Via: HTTP/1.1 (IBM-PROXY-WTE), 1.0 NSW-PROXY
Server: Apache/1.3.22 (Unix) mod_perl/1.26 PHP/4.0.6
Content-Length: 1766
Content-Type: text/html
ETag: "57532-6e6-3bf6bcac"
Last-Modified: Sat, 17 Nov 2001 19:38:20 GMT
Client-Date: Wed, 21 Nov 2001 12:33:19 GMT
Client-Peer: 10.1.17.5:8080
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|