# common option and torsocks(1) wrapping for curl(1)
# Eventually, we may support using libcurl via Inline::C and/or
# WWW::Curl; but curl(1) is most prevalent and widely-installed.
+# n.b. curl may support a daemon/client model like lei someday:
+# https://github.com/curl/curl/wiki/curl-tool-master-client
package PublicInbox::LeiCurl;
use strict;
use v5.10.1;
$opt->{torsocks} = 'false' if $opt->{'no-torsocks'};
my $torsocks = $opt->{torsocks} //= 'auto';
if ($torsocks eq 'auto' && substr($uri->host, -6) eq '.onion' &&
- (($lei->{env}->{LD_PRELOAD}//'') !~ /torsocks/)) {
+ ($PublicInbox::Config::LD_PRELOAD//'') !~ m!/libtorsocks\b!) {
# "auto" continues anyways if torsocks is missing;
# a proxy may be specified via CLI, curlrc,
# environment variable, or even firewall rule