kilo_bytes has asked for the wisdom of the Perl Monks concerning the following question:

I've read the full documentation but could not get it to work.

With LWP i would just do this below and it works:

my $ua = LWP::UserAgent->new(agent => q{my agent},); $ua->proxy([qw/ http https /] => 'socks://localhost:1510');

I gave up of LWP because it is very slow, HTTP::Tiny is fast but i'm unable to make it work with socks.

Replies are listed 'Best First'.
Re: HTTP::Tiny with localhost socks
by Corion (Patriarch) on Jun 21, 2015 at 20:25 UTC

    HTTP::Tiny does not support SOCKS proxies. The price for the speed is the universality. Maybe you want to use WWW::Curl.

      I just found a solution

      use IO::Socket::Socks::Wrapper ( 'HTTP::Tiny::Handle::connect()' => { ProxyAddr => 'localhost', ProxyPort => 1510, SocksVersion => 4, Timeout => 15 } );

      Then you just use Tiny normally as you like. The performance decreased but still faster than LWP. I will check the performance of WWW::Curl