<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package LWP::Protocol::loopback;

use strict;
use vars qw(@ISA);
require HTTP::Response;

require LWP::Protocol;
@ISA = qw(LWP::Protocol);

sub request {
    my($self, $request, $proxy, $arg, $size, $timeout) = @_;

    my $response = HTTP::Response-&gt;new(200, "OK");
    $response-&gt;content_type("message/http; msgtype=request");

    $response-&gt;header("Via", "loopback/1.0 $proxy")
	if $proxy;

    $response-&gt;header("X-Arg", $arg);
    $response-&gt;header("X-Read-Size", $size);
    $response-&gt;header("X-Timeout", $timeout);

    return $self-&gt;collect_once($arg, $response, $request-&gt;as_string);
}

1;
</pre></body></html>