mirror of
https://git.proxmox.com/git/libhttp-daemon-perl
synced 2025-10-05 21:30:39 +00:00
32 lines
573 B
Perl
Executable File
32 lines
573 B
Perl
Executable File
#!/local/perl/bin/perl -w
|
|
|
|
use HTTP::Daemon ();
|
|
|
|
my $s = new HTTP::Daemon;
|
|
die "Can't create daemon: $!" unless $s;
|
|
|
|
print $s->url, "\n";
|
|
|
|
my $c = $s->accept;
|
|
die "Can't accept" unless $c;
|
|
|
|
$c->timeout(60);
|
|
my $req = $c->get_request;
|
|
|
|
die "No request" unless $req;
|
|
|
|
my $abs = $req->uri->abs;
|
|
|
|
print $req->as_string;
|
|
|
|
$c->send_file_response("/etc");
|
|
|
|
#$c->send_redirect("http://www.sn.no/aas", 301, "<title>Piss off</title>");
|
|
|
|
#my $res = HTTP::Response->new(400, undef,
|
|
# HTTP::Headers->new(Foo => 'bar'),
|
|
# "Gisle\n"
|
|
# );
|
|
#$c->send_response($res);
|
|
|