-
-
10 Dec 2021 08:50:09 UTC
- Distribution: Sniffer-HTTP
- Module version: 0.25
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers (96 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: unknown
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (26.89KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Class::Accessor
- Class::Data::Inheritable
- Exporter
- HTTP::Request
- HTTP::Response
- LWP::Simple
- Net::Pcap
- NetPacket::TCP
- parent
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Sniffer::Connection::HTTP - Callbacks for a HTTP connection
SYNOPSIS
You shouldn't use this directly but via Sniffer::HTTP which encapsulates most of this.
my $sniffer = Sniffer::Connection::HTTP->new( callbacks => { request => sub { my ($req,$conn) = @_; print $req->uri,"\n" if $req }, response => sub { my ($res,$req,$conn) = @_; print $res->code,"\n" }, } ); # retrieve TCP packet in $tcp, for example via Net::Pcap my $tcp = sniff_tcp_packet; $sniffer->handle_packet($tcp);
TODO
Think about pipelined connections. These are not easily massaged into the request/response scheme. Well, maybe they are, with a bit of hidden logic here.
Every response accumulates all data in memory instead of giving the user the partial response so it can be written to disk. This should maybe later be improved.
BUGS
The whole module suite has almost no tests.
If you experience problems, please supply me with a complete, relevant packet dump as the included
dump-raw.pl
creates. Even better, supply me with (failing) tests.AUTHOR
Max Maischein (corion@cpan.org)
COPYRIGHT
Copyright (C) 2005-2021 Max Maischein. All Rights Reserved.
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Sniffer::HTTP, copy and paste the appropriate command in to your terminal.
cpanm Sniffer::HTTP
perl -MCPAN -e shell install Sniffer::HTTP
For more information on module installation, please visit the detailed CPAN module installation guide.