summaryrefslogtreecommitdiff
path: root/t/misc/httpd
diff options
context:
space:
mode:
Diffstat (limited to 't/misc/httpd')
-rwxr-xr-xt/misc/httpd31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/misc/httpd b/t/misc/httpd
new file mode 100755
index 0000000..f17a2bf
--- /dev/null
+++ b/t/misc/httpd
@@ -0,0 +1,31 @@
+#!/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);
+