hi,
I'm trying to work through my ISP provider's proxy, but for some reason every time I issue a request with it I get the ISP's homepage, which is obviously not the page I requested. I tried two scripts. The first is:
use LWP::Simple qw(&getstore $ua); $ua->proxy(http => 'http://www.tau.ac.il/tau.pac'); my $url='http://www.yahoo.com'; my $file='test.html'; print "success" if (getstore($url, $file));
The second is:
use LWP::UserAgent; open WFH, ">test.html" or die($!); my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/5.0"); $ua->env_proxy; $ua->proxy('http', 'http://www.tau.ac.il/tau.pac'); $ua->timeout(10); my $response = $ua->get('http://search.cpan.org/'); if ($response->is_success) { print WFH $response->content; } else { die $response->status_line; }
Any ideas as to the reason?
-----------------------------------
Any comments about coding style are welcome.In reply to lwp proxy problem by dannoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |