Closed Bug 27119 Opened 25 years ago Closed 22 years ago

http log traffic and headers

Categories

(Core :: Networking: HTTP, enhancement, P3)

enhancement

Tracking

()

VERIFIED WORKSFORME
Future

People

(Reporter: dougt, Assigned: darin.moz)

References

Details

We should add this to some sort of debugging log file. From Steve's document: To print out http headers, add the following to the SetHeader methods in nsHTTPRequest.cpp and nsHTTPResponse.cpp NS_METHOD nsHTTPRequest::SetHeader(nsIAtom* i_Header, const char* i_Value) { /* display headers as they get set */ nsString atom; i_Header->ToString(atom); char* s = atom.ToNewCString(); printf("-----REQUEST: <%s> <%s>\n",s, i_Value); return mHeaders.SetHeader(i_Header, i_Value); } nsresult nsHTTPResponse::SetHeader(nsIAtom* i_Header, const char* i_Value) { /* display headers as they get set */ nsString atom; i_Header->ToString(atom); char* s = atom.ToNewCString(); printf("-----RESPONSE: <%s> <%s>\n",s, i_Value); return mHeaders.SetHeader(i_Header, i_Value); } To print out the raw traffic received by the browser, add the following print statements: 1. mozilla/netwerk/protocol/http/src nsHTTPResponseListener.cpp after the call to ReadSegment in ParseStatusLine: printf("*** status = %s\n", mHeaderBuffer.GetBuffer()); 2. mozilla/netwerk/protocol/http/src nsHTTPResponseListener.cpp after the call to ReadSegment in ParseHTTPHeader(): printf("*** header = %s\n", mHeaderBuffer.GetBuffer()); 3. mozilla/netwerk/streamconv/Converters nsMultiMixedConv.cpp after the call to inStr->Read in OnDataAvailable(): printf("*** multipart=%s\n", buffer); To print out the raw traffic send by the browser, add the following print statement: 1. mozilla/netwerk/protocol/http/src nsHTTPRequest.cpp just before return in nsHTTPRequest::WriteRequest printf("~~~%s",mRequestBuffer.GetBuffer());
Target Milestone: M17
reassign to gagan
Assignee: dougt → gagan
Moving post beta bugs to M18 which is now the post-beta milestone.
Target Milestone: M17 → M18
note that you can switch on HTTP logging by- set NSPR_LOG_MODULES=nsHTTPProtocol:5 set NSPR_LOG_FILE=http.log
Assignee: gagan → nobody
Keywords: helpwanted
Target Milestone: M18 → Future
mass move, v2. qa to me.
QA Contact: tever → benc
Severity: normal → enhancement
Component: Networking → Networking: HTTP
Summary: Make http log traffic and headers → [RFE] http log traffic and headers
*** Bug 78315 has been marked as a duplicate of this bug. ***
in why build does the set NSPR_LOG_MODULES=nsHTTPProtocol:5 set NSPR_LOG_FILE=http.log work? if you download a normal installer build it doesn't work.
*** Bug 112389 has been marked as a duplicate of this bug. ***
*** Bug 119883 has been marked as a duplicate of this bug. ***
Summary: [RFE] http log traffic and headers → http log traffic and headers
*** Bug 175830 has been marked as a duplicate of this bug. ***
*** Bug 175830 has been marked as a duplicate of this bug. ***
Not sure if this warrants another enhancement request, but I would personally like to see this functionality in the non-debug releases, maybe as a supplement to the View Source for a given page. I'd like to be able to see the HTTP requests and responses for a given page (or resource, whatever). I don't need this information to debug my browser, but to debug my web site. Sometimes it's useful to be able to see exactly what character set it's returning, or any of the other HTTP headers that aren't expressed through some other dialog in the browser. Presently the only way I can do this today is by sending raw HTTP over a telnet connection.
I remember this being covered by another bug somewhere...
Assignee: nobody → darin
Keywords: helpwanted
QA Contact: benc → httpqa
Whiteboard: dupeme
set these environment variables before running mozilla (debug or nightly build): NSPR_LOG_MODULES=nsHttp:2 NSPR_LOG_FILE=c:\http.log and you will get a stream of request/response headers dumped in c:\http.log. (i usually set these in a DOS prompt and then run mozilla from the DOS prompt.) marking WORKSFORME
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
*** Bug 132248 has been marked as a duplicate of this bug. ***
verified wfm, this has been working for awhile
Status: RESOLVED → VERIFIED
Whiteboard: dupeme
QA Contact: httpqa → tever
*** Bug 188816 has been marked as a duplicate of this bug. ***
I think an obvious point (wishlist idea) has been missed. Users are asking for a window that opens in Mozilla (not unlike a 'View Source' or JavaScript console window). Something that is easy to use. Changeing builds and searching for logs is not fun. If this was implimented Mozzila would be an even bigger killer app for web developers. As one myself I beg a software developer to make this addition [soon].
just install: http://livehttpheaders.mozdev.org/ it has all of the features!
Guys, I've just stumbled on interesting implementation of the requested functionality: http://livehttpheaders.mozdev.org In essence that's exactly what we're looking for. It's a plugin and I'm sure it worth to be merged with the Mozilla's base.
Blocks: 669259
You need to log in before you can comment on or make changes to this bug.