-   Programming (
-   -   proxy authentication (

joesbox 02-23-2003 07:25 AM

proxy authentication
first the script then the problem:

foreach $tropical (@tropical) {
print "$tropical\n";
$name =$tropical;
#print "$name\n";
$name =~ s/$baseurl\///;
print "$name\n";
$hdrs = new HTTP::Headers(Accept => 'image/gif', User-Agent => 'Mozilla/4.0 compatible MSIE 5.5 Windows NT4.0');
$ua = new LWP::UserAgent;
$ENV{HTTPS_PROXY} = '***.***.***.***:8080';
$url = new URI::URL("$tropical");
$hdrs = new HTTP::Headers(Accept => 'image/gif', User-Agent => 'Mozilla/4.0compatible MSIE 5.5 Windows NT4.0');
$req = new HTTP::Request(GET, $url, $hdrs);
$res = $ua->request($req, "/var/www/html/afwamodels/tropical/$name");
$resp = $ua->request($req);
if ($resp->is_success) {
print "$res\n";
print "got file\n";
}else {
print $resp->message;print " no way\n";

now i am behind a proxy and i have checked with lan support and it is the correct ip (not shown cause net-security would have a fit). now what this does is goes out the a website and retrieves images. then brings them back for sorting. i run the script in the terminal and i get something about

"proxy connect failed" bla bla bla "Proxy Authentication Required....Unable to complete request:.....Access denied due to authentication failure".

does anyone know if there is a way to auto input my username and password into this so that i can avoid this crap? i will obviously use a seperate file that will only be aloud to be seen my me and this script but i need something. boss is going to be upset and i don't want to hear it.

joesbox 02-23-2003 10:13 AM

found the fix. lan support was wrong again. they had changed the ip on me of the proxy and didn't tell. after a ping i got it fixed.

All times are GMT -5. The time now is 05:19 AM.