in reply to Trying to pass through firewall programmatically
Some proxies also require that you send it a username/password in order to let requests through. You should be able to add the required header, with something like this:
Replace proxy.myorg.com, proxy_user and proxy_password with something suitable for your site.use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->proxy(['http', 'ftp'] => 'http://proxy.myorg.com'); $req = HTTP::Request->new('GET',"http://www.perl.com";); $req->proxy_authorization_basic("proxy_user", "proxy_password"); $res = $ua->request($req); print $res->content if $res->is_success;
HTH
--
idnopheq
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Trying to pass through firewall programmatically
by dze27 (Pilgrim) on Sep 11, 2001 at 00:07 UTC |