File: proxy.t

package info (click to toggle)
libapache-mod-perl 1.16-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,580 kB
  • ctags: 1,064
  • sloc: ansic: 4,489; perl: 4,415; sh: 305; makefile: 137
file content (24 lines) | stat: -rw-r--r-- 580 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

use Apache::test;

#hrm, deal with this later
print "1..1\nok 1\n";
exit 0;

unless(defined $ENV{USER} and $ENV{USER} eq "dougm" and
    $net::callback_hooks{PERL_TRANS} and 
    $net::callback_hooks{PERL_STACKED_HANDLERS} and
    $net::callback_hooks{MMN} > 19980270)
{
    print "1..1\nok 1\n";
    exit 0;
}

my $url = "http://$net::httpserver/"."proxytest";
my $ua = LWP::UserAgent->new;
$ua->proxy([qw(http)], "http://$net::httpserver");

my $request = HTTP::Request->new('GET', $url);
my $response = $ua->request($request, undef, undef);
print $response->content;