From:  Neil Stansbury <neil.stansbury@redbacksystems.remove-reply.com>
Date:  19 Dec 2005 10:21:37 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.netlib
Subject:  

Re: HTTP traffic listener/sniffer

NNTP-Posting-Host:  client-82-27-230-118.brnt.adsl.virgin.net

Not sure how much help this will be but...

Have a look at the httpheaders extension, it can intercept all HTTP 
traffic including headers.

Regarding the hung process, I experienced the same with 
nsIFileInputStream, I noticed that if fileStream.CLOSE_ON_EOF is set 
then you cant get the stream, it's needs to be 
nsIFileInputStream.REOPEN_ON_REWIND to intercept the stream itself.

N


Vic wrote:
> Hi,
> 
> I'm looking for a way to log all network traffic at the http level,
> including the messages buffers. Also I need to be able to link between the
> sniffed HTTP conversation to the corresponding HTMLDocument in the web
> browser.
> 
> I've found that logging is being made in nsHttpTransaction.cpp::Init(...)
> and nsHttpTransaction::HandleContentStart() but it does not include the
> messages buffers.
> 
> At both location, I can read the messages buffers using the stream interface
> but when I do, the stream position gets lost and the process gets hang. I
> can't restore the stream position back to were it was because this
> functionality is not available with the given stream interface.
> 
> Every solution or idea will be appreciated.
> 
> Thanks,
> Vic.
> 
>