SourceForge.net Logo

Home | SF Project | Download | Forum | Bugs | History | For Coders | HowTo | Commentary | TODO | Support This Project


Basic | Connection | Advanced | Secure | Certificate | JMX | XML

Don's Proxy Advanced Example HowTo

In order to see all requests and responses for your browser session or web application, we'll need to rely on a traditional proxy to do the routing for us. I highly recommend Apache's httpd. In your Apache configuration, include a block like this:

Listen 8080
<VirtualHost localhost:8080>
    <Location ~ .>
        order deny,allow
        deny from all
        allow from localhost
    </Location>

    ProxyRequests On
    ProxyVia on

</VirtualHost>
change the settings for Proxy, and restart the Proxy and any Subscribers you're running. The new proxy settings will look like this:

Change your browser's proxy settings. Here's how they would look in FireFox:

now browse the site as you normally would, by going to http://google.com, and see all the requests and responses the travel between the browser and the web site:

Sender is CLIENT at 127.0.0.1:36068
Packet ID:21-1
GET http://www.google.com/ HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Cookie: SID=yada

Sender is SERVER at 64.233.167.99:80
Packet ID:21-1
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Server: gws
Content-Length: 2374
Date: Mon, 31 Dec 2007 15:34:57 GMT

Sender is CLIENT at 127.0.0.1:36068
Packet ID:21-2
GET http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: http://www.google.com/
Cookie: SID=yada

Sender is SERVER at 64.233.167.99:80
Packet ID:21-2
HTTP/1.1 200 OK
Content-Type: image/gif
Last-Modified: Wed, 07 Jun 2006 19:38:24 GMT
Expires: Sun, 17 Jan 2038 19:14:07 GMT
Server: gws
Content-Length: 8558
Date: Mon, 31 Dec 2007 15:34:57 GMT

Sender is CLIENT at 127.0.0.1:36068
Packet ID:21-3
GET http://www.google.com/images/nav_logo3.png HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: http://www.google.com/
Cookie: SID=yada

Sender is CLIENT at 127.0.0.1:36070
Packet ID:22-1
GET http://www.google.com/favicon.ico HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Cookie: SID=yada

Sender is SERVER at 64.233.167.99:80
Packet ID:21-6
HTTP/1.1 200 OK
Content-Type: image/png
Last-Modified: Sat, 21 Apr 2007 01:08:10 GMT
Expires: Sun, 17 Jan 2038 19:14:07 GMT
Server: gws
Content-Length: 6336
Date: Mon, 31 Dec 2007 15:34:57 GMT

Sender is SERVER at 64.233.167.99:80
Packet ID:22-1
HTTP/1.1 200 OK
Content-Type: image/x-icon
Last-Modified: Wed, 07 Jun 2006 19:35:34 GMT
Expires: Sun, 17 Jan 2038 19:14:07 GMT
Server: gws
Content-Length: 1406
Date: Mon, 31 Dec 2007 15:34:57 GMT
Now you're probably thinking, "Well, great, but what what about secure traffic?" Funny you should ask.