]> git.proxmox.com Git - libhttp-daemon-perl.git/blob - t/misc/httpd_term.pl
[svn-inject] Installing original source of libhttp-daemon-perl (6.00)
[libhttp-daemon-perl.git] / t / misc / httpd_term.pl
1 #!/local/perl/bin/perl
2
3 use HTTP::Daemon;
4 #$HTTP::Daemon::DEBUG++;
5
6 my $d = HTTP::Daemon->new(Timeout => 60);
7 print "Please contact me at: <URL:", $d->url, ">\n";
8
9 while (my $c = $d->accept) {
10 CONNECTION:
11 while (my $r = $c->get_request) {
12 print $r->as_string;
13 $c->autoflush;
14 RESPONSE:
15 while (<STDIN>) {
16 last RESPONSE if $_ eq ".\n";
17 last CONNECTION if $_ eq "..\n";
18 print $c $_;
19 }
20 print "\nEOF\n";
21 }
22 print "CLOSE: ", $c->reason, "\n";
23 $c->close;
24 $c = undef;
25 }