File: server.pl

package info (click to toggle)
libhttp-server-simple-authen-perl 0.04-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 76 kB
  • sloc: perl: 48; makefile: 7
file content (21 lines) | stat: -rwxr-xr-x 410 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w
use strict;
use lib 'lib';

package MyServer;
use base qw( HTTP::Server::Simple::Authen HTTP::Server::Simple::CGI );

use Authen::Simple::Passwd;
sub authen_handler {
    Authen::Simple::Passwd->new(passwd => '/etc/passwd');
}

sub handle_request {
    my $self = shift;
    my $user = $self->authenticate();
    return unless defined $user;
    print "Hello World";
}

MyServer->new->run;