NAME

Mojo::Server::Daemon - HTTP Server

SYNOPSIS

use Mojo::Server::Daemon;

my $daemon = Mojo::Server::Daemon->new;
$daemon->port(8080);
$daemon->run;

DESCRIPTION

Mojo::Server::Daemon is a simple and portable async io based HTTP server.

ATTRIBUTES

Mojo::Server::Daemon inherits all attributes from Mojo::Server and implements the following new ones.

address

my $address = $daemon->address;
$daemon     = $daemon->address('127.0.0.1');

group

my $group = $daemon->group;
$daemon   = $daemon->group('users');

ioloop

my $loop = $daemon->ioloop;
$daemon  = $daemon->ioloop(Mojo::IOLoop->new);

keep_alive_timeout

my $keep_alive_timeout = $daemon->keep_alive_timeout;
$daemon                = $daemon->keep_alive_timeout(15);

listen_queue_size

my $listen_queue_size = $daemon->listen_queue_zise;
$daemon               = $daemon->listen_queue_zise(128);

max_clients

my $max_clients = $daemon->max_clients;
$daemon         = $daemon->max_clients(1000);

max_keep_alive_requests

my $max_keep_alive_requests = $daemon->max_keep_alive_requests;
$daemon                     = $daemon->max_keep_alive_requests(100);

port

my $port = $daemon->port;
$daemon  = $daemon->port(3000);

user

my $user = $daemon->user;
$daemon  = $daemon->user('web');

METHODS

Mojo::Server::Daemon inherits all methods from Mojo::Server and implements the following new ones.

prepare_ioloop

$daemon->prepare_ioloop;

run

$daemon->run;

setuidgid

$daemon->setuidgid;