Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Incase You Need to Use a Proxy with LWP

by arunhorne (Pilgrim)
on May 13, 2002 at 15:40 UTC ( #166212=note: print w/ replies, xml ) Need Help??


in reply to Retrieving Data from URL

Thanks, LWP worked brilliantly.

Just as an aside for anyone looking at this thread in the future, I am behind a firewall and so had to add the following code to make it all work.

use LWP::Simple qw(&getstore &is_success $ua);

The above imports the $ua variable and the subs I needed, $ua (User Agent, see LWP::UserAgent) is used to set proxy settings.

# Initialise the proxy $ua->proxy(http => 'http://wwwcache.ex.ac.uk:8080'); #$ua->proxy_authorization_basic( 'username', 'password' );

The above actually sets the proxy. I didn't need any proxy auth, but you might, hence the line is there but commented out. Once this is done the subs like getstore worked great.

Hope this helps in the future.

Best wishes and thanks again, Arun


Comment on Incase You Need to Use a Proxy with LWP
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://166212]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-09-02 23:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (33 votes), past polls