Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Proxy link rotation

by OlegG (Monk)
on Jan 27, 2012 at 17:33 UTC ( [id://950422]=note: print w/replies, xml ) Need Help??


in reply to [Resolved]Proxy link rotation

Some time ago I writed LWP::UserAgent subclass, which main purpose is to automate proxy rotation for each request. It is not finished, not well tested and not documented yet, but you can try: LWP::UserAgent::Proxified
Simpliest variant of usage:
use LWP::UserAgent::Proxified; my $ua = LWP::UserAgent::Proxified->new( proxylist => [ ['http', 'https'] => 'http://10.0.0.1:1080', ['http', 'https'] => 'http://10.0.0.2:1080' ], proxyrand => 1, # choose random proxy for each request # other lwp options goes here );

Replies are listed 'Best First'.
Re^2: Proxy link rotation
by kazak (Beadle) on Jan 27, 2012 at 21:14 UTC
    I need to use 250-300 different proxies, all these proxies require authorization, also I need some special filter for disabling and enabling proxies in proxy-list (something like grey list),etc . Is there any mechanisms to implement these things within your class?
      I think you can
      use strict; use LWP::UserAgent::Proxified; open( ROUTES, "<", "/etc/squid/repeater/lib/routes.cfg" ) or die "open: $!"; my @proxylist; while( <ROUTES> ) { s/#.*//; next if /^(\s)*$/; chomp; push @proxylist, http => "http://uname:passwd\@$_" if !/DISABLED/; } close(ROUTES); my $ua = LWP::UserAgent::Proxified->new( agent => undef, proxylist => \@proxylist, proxyrand => 1 ); # do the job

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950422]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-19 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found