NAME
LWP::UserAgent::RandomProxyConnect - A LWP::UserAgent extension for becoming an omnipresent client.
VERSION
Version 1.10
SYNOPSIS
This Object does exactly the same than the LWP::UserAgent class with a new useful feature: it can make each HTTP request throw a different proxy each time. Also, a few methods improve the proxy list management, and makes the iterative connections faster.
CONSTRUCTOR
new()
When this class is invoked as:
my $obj = LWP::UserAgent::RandomProxyConnect->new
several test will be made. First, the class must find a valid file with a proxy list, if not, this object will stop. This file must be placed in the environmental variable $ENV{PROXY_LIST}.
However, the class can be invoked as:
my $obj = LWP::UserAgent::RandomProxyConnect->new(-proxy_list => $proxy_file_path)
the created object will search the file at the specified path.
Whatever the method you use to invoke the class, the object will stop if the specified file doest not exists, is not readable or there is no proxy found into it.
Furthermore, you can add as argument all the properties described at LWP::UserAgent
THE EXTENDED REQUEST METHOD
request
This method is exactly the same than LWP::UserAgent->request LWP::UserAgent with the implemented proxy-change in each request. It obiously make the connection slowler. NOTICE: Only http and https protocols are allowed.
env_proxy
This function overrides the original function in order to avoid the static proxy configuration
ATTRIBUTES
As inherited class from LWP::UserAgent, it contains the described attributes at LWP::UserAgent, but there is some new attributes in this class:
proxy_list (Default value: $ENV{"PROXY_LIST"})
The proxy_list
attribute contains the string with the proxy list file path. The accessor method:
my $proxy_list = $obj->get_proxy_list;
returns such string.
Also it can be set by the mutator method:
$obj->set_proxy_list($new_proxy_list_value);
protocols_allowed (Default value: ['http','https'])
Protocols allowed to stablish the communication.
protocol (Default value: 'http')
The protocol used to communicate. e.g.: if the specified protocol is "ftp", the absolute proxy URI will be:
ftp://proxy.url.or.ip:port/
METHODS FOR HANDLING THE PROXY LIST
renove_proxy
This function returns a new random proxy from the list. This return value is a string with the format: <proxyUrlorIP>:<port>. This is just a query for a single request.
AUTHOR
Hector Valverde, <hvalverde at uma.es>
BUGS
Please report any bugs or feature requests to bug-lwp-useragent-randomproxyconnect at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LWP-UserAgent-RandomProxyConnect. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc LWP::UserAgent::RandomProxyConnect
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=LWP-UserAgent-RandomProxyConnect
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
http://cpanratings.perl.org/d/LWP-UserAgent-RandomProxyConnect
Search CPAN
http://search.cpan.org/dist/LWP-UserAgent-RandomProxyConnect/
ACKNOWLEDGEMENTS
I thank the University of Malaga for being so incompetent and make me prove it.
LICENSE AND COPYRIGHT
Copyright 2012 Hector Valverde.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.