You wouldn't happen to know of a quick way to switch between two different proxies all day long, would you? :-|
#!/usr/bin/perl -w
use HTTP::Proxy;
use HTTP::Proxy::HeaderFilter::simple;
my @proxy = qw( http://localhost:8080/ http://proxy2:8080/ );
my $proxy = HTTP::Proxy->new(@ARGV);
$proxy->push_filter(
request => HTTP::Proxy::HeaderFilter::simple->new(
sub {
shift->proxy->agent->proxy( http => $proxy[ rand @proxy ] );
}
)
);
$proxy->start;
Re:You *knew* I would answer this, didn't you?
cog on 2004-10-28T15:31:56
Given that I did not mention any fishnets, no, I didn't know you would answer it O:-)
Anyway, your code seems really useful for several things... but it was not what I was looking for (unless I implement that somewhere within Firefox...)
What I had in mind was a button (maybe in the toolbar or something) that, on a click, would alternate between two different proxies I happen to use ("Edit -> Preferences -> Connection Settings -> Copy&Paste what I need" just seems to tedious...)
Thanks to Danius, I have now installed SwitchProxy.
Hurrah!