tags:

views:

1084

answers:

2

Dear StackOverflow Community,

I am looking to get access to all HTTP traffic on my machine (my windows machine - not a server). From what I understand having a local proxy through which all traffic routes is the way to go. I have been Googling but failed to find any resources (in respect to Ruby) to help me out. Any tips or links are much appreciated.

Thank you,

Ice

+1  A: 

Is having a proxy built in Ruby the important point here? Or just to "get access to all HTTP traffic on your machine"? If the latter, there's a free program called HTTP Sniffer and Analyzer that can supposedly do this. I have not used it but I have seen it get some positive reviews. There are several other such programs, though most seem to be paid. On OS X, Linux, etc, you can use the in-built tcpdump in clever ways to get a similar effect.

Peter Cooper
+2  A: 

There's an HTTP Proxy in WEBrick (part of Ruby stdlib) and here's an implementation example: http://90kts.com/blog/2008/httpwatch-a-free-alternative-using-ruby/

If you like living on the edge there's also em-proxy by Ilya Grigorik. http://github.com/igrigorik/em-proxy/tree/master http://www.igvita.com/2009/04/20/ruby-proxies-for-scale-and-monitoring/ It does seem to need some tweaking to solve your problem.

Jonas Elfström
I'm posting this comment through a WEBrick http proxy - Guess it works :)
jrhicks
Good for you! Even though I don't know why you want to do that.
Jonas Elfström
webrick proxy won't return the response to the browser until the request to the remote server is complete, so if you are going to request large files forget about it.
knoopx