Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • #!/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;

    • 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...)
  • There's nothing like thinking out loud in your journal :-)

    Thanks to Danius, I have now installed SwitchProxy [nettripper.com].

    Hurrah! :-D