develooper Front page | perl.libwww | Postings from January 2002

LWP and different ports

Thread Next
From:
Daniel Harrison
Date:
January 16, 2002 15:03
Subject:
LWP and different ports
Message ID:
3C4607AF.DB5654D7@loudcloud.com
I could be completely missing the ball on this one so any input is
appreciated. =) 

I have a script that runs some tests (in this case security) against
web servers but I have ran into a problem when I want to test web
servers that aren't on port 80. The code I currently have is:

   use LWP::UserAgent;
   use URI::Heuristic;
   my $raw_url = "$target/whatever.html";
   my $url = URI::Heuristic::uf_urlstr($raw_url);
   $| = 1;                                
   my $ua = LWP::UserAgent->new();
   my $req = HTTP::Request->new(GET => $url);
   $response = $ua->request($req);

Which works fine but when I modified the code to read:

   use LWP::UserAgent;
   use URI::Heuristic;
   my $raw_url = "$target:$port/whatever.html";
   my $url = URI::Heuristic::uf_urlstr($raw_url);
   $| = 1;                                
   my $ua = LWP::UserAgent->new();
   my $req = HTTP::Request->new(GET => $url);
   $response = $ua->request($req);




It no longer worked. I added a line to print out the value of $raw_url
and it was in the correct format - (192.168.11.122:8000/whatever.html)


Any suggestions?


thanks.

-dan

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About