[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

HTTP Proxy instruction?

Ben Weeks

1/22/2008 4:48:00 PM

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?

-Ben

4 Answers

Joel VanderWerf

1/22/2008 6:57:00 PM

0

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?

One place to look is the httpproxy.rb that comes with webrick in the
standard ruby libs. No tutorial AFAIK, but it's fairly simple code.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Francis Cianfrocca

1/23/2008 12:59:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Jan 22, 2008 11: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?
>



Do you need a forward proxy or a reverse proxy? Does it need to be
transparent (which would require some kind of address translation) or do you
want the ordinary HTTP-proxy kind?

GOTO Kentaro

1/23/2008 1:22:00 PM

0

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

Ben Weeks

1/23/2008 7:23:00 PM

0

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
>
>