Ben Weeks
1/23/2008 7:23:00 PM
That's the perfect starting point. Thanks Gotoken and everybody else.
On Jan 23, 2008 8:22 AM, GOTO Kentaro <gotoken@gmail.com> wrote:
>
> On Jan 23, 2008 1:48 AM, Ben Weeks <bweeks@gmail.com> wrote:
> > I'm looking to create a proxy that will scrape all my http headers and
> > post them to stdout. My searches have been vacant on this topic, does
> > anybody know of any good tutorials out there?
>
> Try this one-liner,
>
> % ruby -r webrick/httpproxy -e 's = WEBrick::HTTPProxyServer.new(:Port
> => 9999, :RequestCallback => Proc.new{|req,res| puts req.request_line,
> req.raw_header}); trap("INT"){s.shutdown}; s.start'
>
> webrick/httprequest.rb defines APIs of a req object.
>
>
> HTH
>
> Gotoken
>
>