How to write a program that mimics Fiddler by using tcpdump or from scratch?

Posted by ???? on Stack Overflow See other posts from Stack Overflow or by ????
Published on 2011-03-12T19:49:04Z Indexed on 2011/03/13 0:10 UTC
Read the original article Hit count: 178

Filed under:
|
|
|
|

When Fiddler is not on Mac OS X or Ubuntu, and if we don't install/use Wireshark or any other more heavy duty tools, what is a way to use tcpdump so that

1) It can print out

GET /foo/bar HTTP/1.1
    [request content in RAW text]
    [response content in RAW text]
POST /foo/... HTTP/1.1

this should be able to be done by tcpdump or by using tcpdump in a short shell script or Ruby / Python / Perl script.

2) Actually, it can be neat if a script can output HTML, with

GET /foo/bar HTTP/1.1
POST /foo/... HTTP/1.1

on the page, for any browser to display, and then when clicked on any of those lines, it will expand to show the RAW content like (1) above does. Click again and it will hide the details. The expansion UI can be done using jQuery or any JS library. The script may be short... possibly less than 20 lines? Does anybody know how to do it either for (1) or (2)?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about bash