Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Well, uh, I'm just writing a module that's called HTTP::Proxy. ;-)

The goal is to be able to pass every request and response though a set of configurable Perl "filters".

Here's an example script that creates a anonymizing proxy, just like in merlyn's column (his script has been one of my inspirations, along with two others scritps by Abigail and Rafael Garcia-Suarez):

#!/usr/bin/perl -w use HTTP::Proxy qw( :log ); use strict; # a very simple anonymizing proxy my $proxy = HTTP::Proxy->new; $proxy->logmask( shift || NONE ); # log configuration # the anonymising filter $proxy->push_headers_filter( mime => undef, # apply this on any type of content request => sub { $_[0]->remove_header(qw( User-Agent From Referer Cookie )); }, response => sub { $_[0]->remove_header(qw( Set-Cookie )),; }, ); $proxy->start;

(This code works with the development version.)

The proxy is not fully functional yet, though. One of my goal is to create a set of filters that would log the whole session, so that yet another script could (automatically) create a web robot from the session transcript.

If you are interested, there is a web site (older versions and CVS snapshot) and a mailing-list at http://http-proxy.mongueurs.net/. I am interested in help, and comments on the API (which is subject to change).


In reply to Re: Pass through perl http proxy server (no code, just advice) by BooK
in thread Pass through perl http proxy server (no code, just advice) by tachyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found