Redirecting socket connections in LWP::UserAgent or WWW::Mechanize

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I use WWW::Mechanize to automate a certain web task.

I connect to a HTTPS website

However, I want to connect from another IP address, other than what
the computer is.

Since I have a lot of servers, I could easily set up SSH port
forwardings so that a connection to localhost:9876 would be redirected
as a connection to port 443, through a remote server that I

My question is how to instruct LWP::UserAgent or WWW::Mechanize to
route connections through localhost:9876, and not to port

In the end, the end result will be the same, I will connect to port 443, but through a tunnel to a completely different

What I am not sure is how to tell LWP::UserAgent to do so.

The proxy settings seem to do something a little different.

I am using linux, by the way.


Re: Redirecting socket connections in LWP::UserAgent or WWW::Mechanize

OK, I figured it out.

1. Open a SOCKS proxy tunnel with ssh -D
2. Instruct LWP::UserAgent to use localhost:port for socks proxying
3. Disable the buggy in perl modules under /usr. This
   last one is upsetting, of course.


Quoted text here. Click to load it

Site Timeline