proxies in perl?

dirtbag

BANNED
Joined
Jul 24, 2008
Messages
990
Reaction score
534
i have looked at a couple modules on cpan, and read the perldocs.. i don't really have much of an nderstanding as the docs are fairly thin. google hasn;t turned up a whole lot. if i build, say, a forum spammer. and i want to introduce proxies for the posting, what sthe best route to go?
 
Well OP is over a week old, but if your still looking...

I have not tested this, but I imagine that libcurl for PERL has the same proxy support as libcurl for PHP. So it would probably look something like this:

Code:
#!/usr/bin/perl
#

use strict;
use WWW::Curl::Easy;

my $url = "http://forums.dp.com/";
my $proxy = "69.69.69.69";
my $port = "8080";

# Init the curl session
my $curl= WWW::Curl::Easy->new() or die "curl init failed!\n";

# Follow location headers
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
                                                                        
$curl->setopt(CURLOPT_URL, $url);

# Enable proxy support
$curl->setopt(CURLOPT_PROXY, $proxy);
$curl->setopt(CURLOPT_PROXYPORT, $port);

and so on and so forth...
 
Well OP is over a week old, but if your still looking...

I have not tested this, but I imagine that libcurl for PERL has the same proxy support as libcurl for PHP. So it would probably look something like this:

Code:
#!/usr/bin/perl
#

use strict;
use WWW::Curl::Easy;

my $url = "http://forums.dp.com/";
my $proxy = "69.69.69.69";
my $port = "8080";

# Init the curl session
my $curl= WWW::Curl::Easy->new() or die "curl init failed!\n";

# Follow location headers
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
                                                                        
$curl->setopt(CURLOPT_URL, $url);

# Enable proxy support
$curl->setopt(CURLOPT_PROXY, $proxy);
$curl->setopt(CURLOPT_PROXYPORT, $port);

and so on and so forth...

thanks, i'll loo this ove rin a day or two when i free up some time. for now i'm playing around with using LWP::UserAgent's proxy support. I'll check all options though :)
 
like this:

$ua->proxy(['http', 'ftp'], 'http://proxy:8080/');

set this before you send out the $ua request
 
Back
Top