ISO simple debugging sniffer for HTTP

showellshowell at gmail.com showellshowell at gmail.com
Tue Sep 16 05:58:27 CEST 2008


Hi everybody,

I'm looking for a very simple HTTP debugging sniffer in Python--
hopefully 200 lines of less--that allows me to write simple methods to
inspect requests and responses.  It would ideally work like this:

  sniffer = SimpleHttpDebuggingSniffer(actual_host_address,
actual_host_port)
  sniffer.listening_port = SOME_PORT_ON_MY_DESKTOP
  sniffer.inbound_inspector = some_method_i_write
  sniffer.outbound_inspector = some_other_method_i_write
  sniffer.run()

I would launch it from a Linux desktop terminal and use it help debug
a Java application I'm maintaining that uses an opaque library to hit
an opaque service.  I can configure the client app to connect to the
sniffer, and apart from inspecting packets, I just want it to pass
data along to the real server.  I'm not using any complicated part of
the HTTP protocol--it's mostly simple request, simple response, but
the payloads are not plain text, so I need some Python code to make
sense of them.

I've googled a bit, and I've come up with a lot of noise, so I'm
hoping some one can point me in the direction of some simple code that
they have confidence in, which is free and all that good stuff.

Thanks,

Steve





More information about the Python-list mailing list