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