Skip to content

Instantly share code, notes, and snippets.

@bahayman
bahayman / gist:9369651
Created March 5, 2014 15:38
tcpdump http monitor
Use TCPDUMP to Monitor HTTP Traffic
1. To monitor HTTP traffic including request and response headers and message body:
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
2. To monitor HTTP traffic including request and response headers and message body from a particular source:
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
3. To monitor HTTP traffic including request and response headers and message body from local host to local host:
@beppu
beppu / async-soap-requests.pl
Created March 16, 2011 20:34
Can SOAP::Lite be tricked into being AnyEvent+Coro-friendly?
#!/usr/bin/env perl
use common::sense;
use AnyEvent;
use Coro;
use AnyEvent::HTTP::LWP::UserAgent;
use SOAP::Lite; # +trace => 'all';
use SOAP::Transport::HTTP; # preload it so that we can set USERAGENT_CLASS reliably;
my @results;