I would suggest that based on the error, you indicated that your proxy blocks a specific User-Agent. The HTTP user agent used by LWP :: UserAgent is different from the WWW :: Mechanize interface.
I suggest trying this line:
my $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36' );
This will force the proxy server and the receiving server to believe that you are a Chrome browser and not some crawler / malware / virus / etc
Another suggestion is to make a data damper on the $ mech element and confirm that it is "inside":
use Data::Dumper; print Dumper($mech);
You can also use the same method to delete the contents of $mech
after calling the get()
function.
I'm not sure that this is relevant, but note that not all Proxies support HTTPS / SSL, only those that allow proxy proxy / proxy connection through CONNECT will allow you HTTPS / SSL proxy traffic.
source share