about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/LeiCurl.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiCurl.pm b/lib/PublicInbox/LeiCurl.pm
index ce57e796..5ffade99 100644
--- a/lib/PublicInbox/LeiCurl.pm
+++ b/lib/PublicInbox/LeiCurl.pm
@@ -75,6 +75,11 @@ EOM
 sub for_uri {
         my ($self, $lei, $uri, @opt) = @_;
         my $pfx = torsocks($self, $lei, $uri) or return; # error
+        if ($uri->scheme =~ /\Ahttps?\z/i) {
+                my $cfg = $lei->_lei_cfg;
+                my $p = $cfg ? $cfg->urlmatch('http.Proxy', $$uri) : undef;
+                push(@opt, "--proxy=$p") if defined($p);
+        }
         bless [ @$pfx, @$self, @opt, $uri->as_string ], ref($self);
 }