use HTTP::Daemon::SSL; use HTTP::Status; # Make sure you have a certs/ directory with "server-cert.pem" # and "server-key.pem" in it before running this! my $d = HTTP::Daemon::SSL->new || die; print "Please contact me at: url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET' and $r->url->path eq "/xyzzy") { # remember, this is *not* recommened practice :-) $c->send_file_response("/etc/passwd"); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); } #### use Net::Daemon::SSL; package MyDaemon; @MyDaemon::ISA = qw (Net::Daemon::SSL); sub Run { my $this = shift; my $buffer; $this->{socket}->print ( "vasja was here\n" ); $this->{socket}->sysread ( $buffer, 100 ); # Attention! getline() method # do not work with IO::Socket::SSL # version 0.73 # see perldoc IO::Socket::SSL # for more details } package main; my $daemon = new MyDaemon ( {}, \ @ARGV ); # you can use --help command line key $daemon || die "error create daemon instance: $!\n"; $daemon->Bind();