perlnew has asked for the wisdom of the Perl Monks concerning the following question:

I installed LWP and libnet module on a server behide firewall and try to run this to test the modules: perl -MLWP::Simple -e "getprint 'http://www.yahoo.com'" It returns '500' error 'connect refused'. BUT, it ran ok with an URL on the server. Q: is this because of the firewall? is this configure issues on either LWP or libnet? pls show me your wisdom. Thanks you master.

Replies are listed 'Best First'.
Re: Connection refused error
by gav^ (Curate) on Jan 17, 2002 at 07:14 UTC
    It sounds like you need to go through a proxy. Documentation on how to do this with LWP can be found here

    Hope this helps...

    gav^

Re: Connection refused error
by Jonathan (Curate) on Jan 17, 2002 at 14:29 UTC
    Shouldn't be too hard, get your proxy's name and number. Something like below works for me.
    use LWP::UserAgent; my $ua = new LWP::UserAgent; $ua->proxy(['http', 'ftp'] => 'http://your_proxy.com:portnumber'); my $req = new HTTP::Request 'GET', "http://www.whatyouwant.com/blah.html"; $req->proxy_authorization_basic("$user_name","$user_password"); $res = $ua->request($req);