Capturing headers from Request/Response

  • Thread starter Thread starter octupul
  • Start date Start date
O

octupul

Basically I have some code that accesses an Internet Explorer interface
directly through COM and the WebBrowserClass. I have access to all the
navigate and alteration functionalites this provides however, when I
try to obtain headers I am at a loss. The only event that seems to
contain this data is OnNavigate2. However, this seems to only include
data sparingly and does not contain any data from response headers.

The long and short of it is I am asking for an example of how to
attatch to an internet explorer window and view all incoming and
outgoing requests/responses in their raw formats.
 
The best way of doing that (and that's the way various automated tools
like Mercury Load Runner and others do that) is to either use and/or
write a proxy server that will run on the same machine.

You then configure your browser to use the proxy server and there you
get all the incoming and outgoing traffic.

There is a nice proxy server implemented in C# that you can get its
source there at http://www.mentalis.org/soft/projects/proxy/.

You can easily customize the code and dump all incoming and outgoing
requests.

Have fun,
Eran
 
I had thought about using a proxy class but, I found in my research
tools such as this http://www.ieinspector.com/ that do a very similiar
thing. I tested it and it seems that it will only grab the headers
from the currently running internet explorer. If it was a proxy I
should see all traffic including traffic generated by other windows.

Thanks,
Bryan
 
The Link I gave in my previous response was to a fully blown proxy
server written in C#.

Compile it, run it and configure the browser to work with it.

When that works you can add some code to dump the full requests and
responses to the C# proxy server and get everything you need.

If you need help in updating the proxy server's code, just raise your
hand :-)

Eran
===========================
Advanced .NET Debugging Blog - http://dotnetdebug.blogspot.com
The place for WinDbg, SOS, Post Mortem and Live debugging
 
Back
Top