my $sniffer = Sniffer::HTTP->new( callbacks => { request => sub { my ($req,$conn) = @_;}, response => sub { my ($res,$req,$conn) = @_;}, log => sub { print $_[0] if $VERBOSE }, tcp_log => sub { print $_[0] if $VERBOSE > 1 }, }, timeout => 5*60, # seconds after which a connection is considered stale stale_connection => sub { my ($s,$conn,$key); if ($key){ print "Connection stalled .... $key ....\n" if $debug; $s->log->("Connection $key is stale."); $s->remove_connection($key); } }, ); $sniffer->run($interface);