From: Ben Weeks Date: 2008-01-24T04:23:14+09:00 Subject: Re: HTTP Proxy instruction? That's the perfect starting point. Thanks Gotoken and everybody else. On Jan 23, 2008 8:22 AM, GOTO Kentaro wrote: > > On Jan 23, 2008 1:48 AM, Ben Weeks 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 > >