lalvin has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on a project that uses WWW::Mechanize::Firefox to visit a website and download a file. I want to access the web site using a different IP. In WWW::Mechanize, I can use local_address method to assign an IP to the mechanize object. However, WWW::Mechanize::Firefox seems not allowing me to use local_address. Are there any alternative methods to assign an IP to an object of WWW::Mechanize::Firefox?
  • Comment on Assign an IP in WWW::Mechanize::Firefox

Replies are listed 'Best First'.
Re: Assign an IP in WWW::Mechanize::Firefox
by Loops (Curate) on Aug 06, 2013 at 02:38 UTC

    With WWW::Mechanize::Firefox there is no direct network connection, all it is doing is controlling a Firefox web browser which handles everything on its own. So you're really asking a Firefox question*.

    However, as far as I know there is no way to bind Firefox to a specific local interface. Instead you would have to configure your operating system to recognize and route the IP traffic as you wish. Alternatively you may be able to setup a proxy server to do this and then configure Firefox to use it instead of talking directly to the external network.

    * It is considered polite to mention that you already asked your question on Stackoverflow.