简体   繁体   中英

How do I configure WWW::Mechanize to work through a proxy?

I sit behind a proxy and have HTTP and WWW::Mechanize working OK locally.

But advice || pointers as to how to get through a proxy please.

Regards Ian

WWW::Mechanize is an extension of LWP::UserAgent :

WWW::Mechanize is a proper subclass of LWP::UserAgent and you can also use any of LWP::UserAgent 's methods.

So you can just use ->env_proxy , or ->proxy — as described in the manual .

Excellent clue depesz||cjm.

It was actually a matter of "rtfm". Forgot the need for the environment variable "HTTP_PROXY". Do not get old you guys !!

Ian

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM