# Using an HTTP proxy to record web traffic

**URL:** <https://www.ruby-forum.com/t/using-an-http-proxy-to-record-web-traffic/60203>\
**Category:** Ruby\
**Created:** [December 2, 2005, 10:14pm UTC](https://www.ruby-forum.com/t/using-an-http-proxy-to-record-web-traffic/60203 "2005-12-02T22:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [December 2, 2005, 10:14pm UTC](https://www.ruby-forum.com/t/using-an-http-proxy-to-record-web-traffic/60203/1 "2005-12-02T22:14:30Z")

</div>

As part of debugging WWW::Mechanize, I realized that the best way to  
compare what my browser is doing to what mechanize is doing would be to  
compare their HTTP transactions incoming and outgoing. What I want is  
an HTTP proxy that can record the transactions and also supports SSL.

The Ruby project doesn’t have any code  
[http://rubyforge.org/projects/rpp/](http://rubyforge.org/projects/rpp/)

This free program doesn’t support SSL, and costs $600.  
[http://www.proxy-sniffer.com/download.html](http://www.proxy-sniffer.com/download.html)

This doesn’t support SSL but is supposed to soon.  
[http://kevinlangdon.com/serviceCapture/](http://kevinlangdon.com/serviceCapture/)

Any other suggestions?

---

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [December 2, 2005, 10:26pm UTC](https://www.ruby-forum.com/t/using-an-http-proxy-to-record-web-traffic/60203/2 "2005-12-02T22:26:38Z")

</div>

Dan K. wrote:

> As part of debugging WWW::Mechanize, I realized that the best way to  
> compare what my browser is doing to what mechanize is doing would be to  
> compare their HTTP transactions incoming and outgoing. What I want is  
> an HTTP proxy that can record the transactions and also supports SSL.

MouseHole is a scriptable proxy. [http://mousehole.rubyforge.org/](http://mousehole.rubyforge.org/)

A script to record traffic would a cinch. Basically,

1. Download MouseHole from the above link. Instructions for running it  
are there as well.

2. Add a script named `proxyrecord.user.rb’ to your  
~/.mouseHole/userScripts/ directory.  
Contains:

3. In your browser, setup MouseHole as your proxy  
([http://127.0.0.1:37004/](http://127.0.0.1:37004/))

4. Visit [http://127.0.0.1:37004/](http://127.0.0.1:37004/) and activate the Proxy Record script by  
checking its box.

As for SSL, I don’t think proxies can actually intercept unencrypted  
SSL. It uses the CONNECT method.

\_why

---

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [December 3, 2005, 1:04am UTC](https://www.ruby-forum.com/t/using-an-http-proxy-to-record-web-traffic/60203/3 "2005-12-03T01:04:50Z")

</div>

Very helpful, why, thanks. I presume I would need to use something  
like WATIR to see the unencrypted contents of an SSL connection by  
getting it directly from IE.
