#!/usr/bin/perl

use LWP::UserAgent;

my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, ag$
$ua->agent('Mozilla/4.0 (compatible; MSIE 5.21; Mac_PowerPC)');

$request = HTTP::Request->new('HEAD',"http://www.apache.org";);
$r = $ua->request($request);

$response = $r->headers->server;

print "$res\n";

----------------------------------------

The output of the above code is:

Apache/2.0.44 (Unix)



Have fun!!

On Thursday, February 6, 2003, at 01:32 PM, Will Eidson wrote:


Hi,

I'm looking for a way to scan webservers and identify the brand of web server reponding.
It looked like header would return the server type but this is not working. Does anyone
have a snippet of code demonstrating this? I'm new to lwp.

Thanks, Will



Reply via email to