>>>>> "Sean" == Sean M Burke <[EMAIL PROTECTED]> writes:

Sean> I recently had reason to want to see exactly what request headers given
Sean> browsers would send, so I wrote this very rough HTTP server that simply
Sean> shows the client its own request. This is about my first attempt at
Sean> socket programming, so forgive me if I'm shocked that it works! (Even
Sean> under MSWin!)

Wouldn't this be simpler, and more apropose to this mailing list?

    use HTTP::Daemon qw(CRLF);
    use HTTP::Response;
    my $d = HTTP::Daemon->new || die;
    print "Please contact me at: <URL:", $d->url, ">\n";
    while (my $c = $d->accept) {
      while (my $r = $c->get_request) {
        my $res = HTTP::Response->new;
        $res->content($r->as_string);
        $res->content_type("text/plain");
        $c->send_response($res);
      }
    }

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to