Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 4722
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: MARKSTOS [...] cpan.org
Requestors: cathalhynes [...] myfastmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.74
Fixed in: (no value)



From: "Cathal Ryan Hynes" <cathalhynes [...] myfastmail.com>
To: bug-WWW-Mechanize [...] rt.cpan.org
Date: Fri, 19 Dec 2003 12:35:01 +0000
Subject: https through a proxy
Hello, my admin tells me that this is a bug in this PERL module. When trying to access an https site with WWW::Mechanize through a proxy I get the following error. Squid does not support all request methods for all access protocols. For example, you can not POST a Gopher request. I also posted this in a PERL forum and they said to Set the environment to USE proxy (export https_proxy=http://proxy:3128/) and tell UserAgent to not do it $ua = LWP::UserAgent->new(env_proxy => 0); But I didn't want to risk doing this with someone else's module. Is there a patch available? I couldn't find one and have been looking for a week now. If not, would you be able to tell me where to stick the code (sorry but messing with someone elses code could get messy). Thankyou very much, I hear that other people have a similar problem. Cathal Ryan Hynes -- Cathal Ryan Hynes cathalhynes@myfastmail.com -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again
Date: Fri, 19 Dec 2003 10:10:03 -0600
From: Andy Lester <andy [...] petdance.com>
To: Cathal Ryan Hynes via RT <bug-WWW-Mechanize [...] rt.cpan.org>
CC: "AdminCc of cpan Ticket #4722": ;
Subject: Re: [cpan #4722] https through a proxy
RT-Send-Cc:
Show quoted text
> Set the environment to USE proxy (export https_proxy=http://proxy:3128/) > and tell UserAgent to not do it $ua = LWP::UserAgent->new(env_proxy => > 0);
Anything you can do with a LWP::UserAgent you can do with Mech. So you should be able to do my $agent = WWW::Mechanize->new( env_proxy => 0 ); Please try that and tell me how it works for you. xoa -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance
From: mh [...] nfs.se
I am having a similar problem. I can get LWP to use my https proxy without any problems by simply just setting https_proxy to the correct value and creating the agent without any options: $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'https://the.site.com'); my $res = $ua->request($req); Doing the same in Mech fails, and it doesn't matter whether I use env_proxy=>0 or env_proxy=>1 in the new() call. Besides, it picks up my http and ftp proxies without problems. /Hacker
From: Nicholas Sushkin
I am having the same problem. Using squid as HTTP Proxy. When I run the https://www.paypal.com sample from the LWP documentation, I get through, when I replace LWP::UserAgent->new() with WWW::Mechanize->new(), I get response code 501. Tracing HTTP exchange reveals that export https_proxy=http://proxyhost:proxyport $b=LWP::UserAgent->new(); $b->get('https://www.paypal.com'); results in the correct request of CONNECT www.paypal.com:443 HTTP/1.0 User-Agent: libwww-perl/5.76 while $b=WWW::Mechanize->new(); $b->get('https://www.paypal.com'); results in an incorrect request of GET https://www.paypal.com/ HTTP/1.1 Connection: close Host: proxyhost User-Agent: WWW-Mechanize/0.72 Please respond to nsushkin@NOSPAMusers.sourceforge.net Thanks.
Subject: workaround: https through a proxy
From: Nicholas Sushkin
$ENV{'https_proxy'} = 'http://proxy:80/'; my $agent = WWW::Mechanize->new(); $agent->proxy(['https'], ''); $agent->get('https://www.paypal.com'); works for me. -- Nicholas Sushkin