96 lines
2.7 KiB
HTML
96 lines
2.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LWP::Debug</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LWP::Debug</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-11-29<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
LWP::Debug - deprecated
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This module has been deprecated. Please see LWP::ConsoleLogger for your
|
|
debugging needs.
|
|
<P>
|
|
|
|
LWP::Debug is used to provide tracing facilities, but these are not used
|
|
by <FONT SIZE="-1">LWP</FONT> any more. The code in this module is kept around
|
|
(undocumented) so that 3rd party code that happens to use the old
|
|
interfaces continue to run.
|
|
<P>
|
|
|
|
One useful feature that LWP::Debug provided (in an imprecise and
|
|
troublesome way) was network traffic monitoring. The following
|
|
section provides some hints about recommended replacements.
|
|
<A NAME="lbAD"> </A>
|
|
<H3>Network traffic monitoring</H3>
|
|
|
|
|
|
|
|
The best way to monitor the network traffic that <FONT SIZE="-1">LWP</FONT> generates is to
|
|
use an external <FONT SIZE="-1">TCP</FONT> monitoring program. The
|
|
WireShark <<A HREF="http://www.wireshark.org/">http://www.wireshark.org/</A>> program is highly recommended for this.
|
|
<P>
|
|
|
|
Another approach it to use a debugging <FONT SIZE="-1">HTTP</FONT> proxy server and make
|
|
<FONT SIZE="-1">LWP</FONT> direct all its traffic via this one. Call <TT>"$ua->proxy"</TT> to
|
|
set it up and then just use <FONT SIZE="-1">LWP</FONT> as before.
|
|
<P>
|
|
|
|
For less precise monitoring needs just setting up a few simple
|
|
handlers might do. The following example sets up handlers to dump the
|
|
request and response objects that pass through <FONT SIZE="-1">LWP:</FONT>
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
use LWP::UserAgent;
|
|
$ua = LWP::UserAgent->new;
|
|
$ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable());
|
|
|
|
$ua->add_handler("request_send", sub { shift->dump; return });
|
|
$ua->add_handler("response_done", sub { shift->dump; return });
|
|
|
|
$ua->get("<A HREF="http://www.example.com">http://www.example.com</A>");
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
LWP::ConsoleLogger, LWP::ConsoleLogger::Everywhere, LWP::UserAgent
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAD">Network traffic monitoring</A><DD>
|
|
</DL>
|
|
<DT id="4"><A HREF="#lbAE">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:47 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|