#!/usr/bin/perl use HTTP::Daemon; use HTTP::Status; my $d = new HTTP::Daemon LocalAddr => '10.0.1.1', LocalPort => 44000; print "Starting: url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { print "Got connection\n"; if ($r->method eq 'GET') { $c->send_file_response("/tmp/reportsock"); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }