in reply to Re: Can't make WWW::Mechanize work through proxy programmatically
in thread Can't make WWW::Mechanize work through proxy programmatically

I looked at the code on that page, but i didn't see anything different from what I did. Does that code actually work through proxy?
  • Comment on Re^2: Can't make WWW::Mechanize work through proxy programmatically

Replies are listed 'Best First'.
Re^3: Can't make WWW::Mechanize work through proxy programmatically
by Anonymous Monk on Sep 25, 2022 at 11:35 UTC
    Proxy setting is set/accepted. Lwp/mech tries to connect to proxy (it works) but can't connect because there is no proxy. Proxy is not bypassed. You say this fails.
      Yes, i've checked, the LWP version works over proxy, but mechanize version doesn't with the same proxy config, using the same ->proxy method with the same options, that work in LWP.
      So, how can I use that knowledge. I still need to use mechanize. Is there a way to use mechanize over LWP? or download with LWP, and process with mechanize?

        Like I said, unlikely story

        #!/usr/bin/perl -- use strict; use warnings; use LWP; use WWW::Mechanize; for my $class ( qw/ LWP::UserAgent WWW::Mechanize /){ my $ua = $class->new; warn "$ua\n"; $ua->show_progress( 1 ); $ua->proxy( [ qw{ http https } ] => q{http://127.6.6.6} ); $ua->get( q{http://example.com} ); } __END__ LWP::UserAgent=HASH(0x99b58c) ** GET http://example.com ==> 500 Can't connect to 127.6.6.6:80 (No co +nnection could be made because the target machine actively refused it +.) (1s) WWW::Mechanize=HASH(0xeb8714) ** GET http://example.com ==> 500 Can't connect to 127.6.6.6:80 (No co +nnection could be made because the target machine actively refused it +.) (1s) Error GETing http://example.com: Can't connect to 127.6.6.6:80 (No con +nection could be made because the target machine actively refused it. +) at lwp-mech-proxy.pl line 14.

        Thats both LWP and Mechanize accepting the proxy setting and trying to connect