Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CPAN-Mini CPAN distribution.

Report information
The Basics
Id: 36124
Status: resolved
Priority: 0/
Queue: CPAN-Mini

People
Owner: Nobody in particular
Requestors: ifomichev [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.569
Fixed in: (no value)



Subject: Cannot connect through proxy since 0.569 without a hack
Hello, Since 0.569 CPAN::Mini uses LWP::UserAgent instead of LWP::Simple. There's a drastic change regarding through proxy connections, since LWP::Simple automatically calls env_proxy on init, but LWP::UserAgent doesn't. And there is no way to set proxy settings gracefully between LWP::UserAgent initand HEAD request which checks connection in CPAN::Mini::new. So there's the only way I found how to make it work through proxy not without a hack: my $cm = CPAN::Mini->new( remote => "http://cpan.makeperl.org/", local => $ENV{CPAN_HOME}, trace => 1, force => 1, skip_perl => 1, exact_mirror => 1, module_filters => [ \&module_filter ], offline => 1, # HACK! ); delete $cm->{offline}; # HACK! $cm->__lwp->env_proxy if $CPAN::Mini::VERSION >= 0.569; $cm->update_mirror; That is not graceful at all. I expect that it would be possible to set LWP::UserAgent instance through CPAN::Mini constructor arguments (to provide better configurability) or there would be a call to env_proxy after LWP::UserAgent constructor (for backwards compatibility with versions before 0.569), so better both. Thank you, Ivan
Subject: Re: [rt.cpan.org #36124] Cannot connect through proxy since 0.569 without a hack
Date: Fri, 23 May 2008 07:20:16 -0400
To: Ivan Fomichev via RT <bug-CPAN-Mini [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] cpan.org>
* Ivan Fomichev via RT <bug-CPAN-Mini@rt.cpan.org> [2008-05-23T04:21:16] Show quoted text
> Since 0.569 CPAN::Mini uses LWP::UserAgent instead of LWP::Simple. > There's a drastic change regarding through proxy connections, since > LWP::Simple automatically calls env_proxy on init, but LWP::UserAgent > doesn't. And there is no way to set proxy settings gracefully between > LWP::UserAgent initand HEAD request which checks connection in > CPAN::Mini::new. So there's the only way I found how to make it work > through proxy not without a hack:
Thanks very much for this bug report. I'll try to cut a new release after breakfast. Actually, I'll probably make changes in git and ask you to test them, since I don't have or use a proxy. -- rjbs
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #36124] Cannot connect through proxy since 0.569 without a hack
Date: Fri, 23 May 2008 08:06:29 -0400
To: Ivan Fomichev via RT <bug-CPAN-Mini [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] cpan.org>
* Ivan Fomichev via RT <bug-CPAN-Mini@rt.cpan.org> [2008-05-23T04:21:16] Show quoted text
> Since 0.569 CPAN::Mini uses LWP::UserAgent instead of LWP::Simple. > There's a drastic change regarding through proxy connections, since > LWP::Simple automatically calls env_proxy on init, but LWP::UserAgent > doesn't. And there is no way to set proxy settings gracefully between > LWP::UserAgent initand HEAD request which checks connection in > CPAN::Mini::new. So there's the only way I found how to make it work > through proxy not without a hack:
Actually, from reading about env_proxy, it looks like a one-line fix to CPAN::Mini to add C<< env_proxy => 1 >> to its creation of a UserAgent should do. Released! -- rjbs