DESCRIPTION

Mojo::Server::Daemon is a full featured non-blocking I/O HTTP 1.1 and WebSocket server with IPv6, TLS and libev support.

Optional modules EV (4.0+), IO::Socket::IP (0.16+) and IO::Socket::SSL (1.75+) are supported transparently and used if installed. Individual features can also be disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables.

group

inactivity_timeout

Maximum amount of time in seconds a connection can be inactive before getting closed, defaults to the value of the MOJO_INACTIVITY_TIMEOUT environment variable or 15. Setting the value to 0 will allow connections to be inactive indefinitely.

listen

List of one or more locations to listen on, defaults to the value of the MOJO_LISTEN environment variable or http://*:3000.

# Listen on IPv6 interface
$daemon->listen(['http://[::1]:4000']);
# Listen on two ports with HTTP and HTTPS at the same time
$daemon->listen([qw(http://*:3000 https://*:4000)]);
# Use a custom certificate and key
$daemon->listen(['https://*:3000?cert=/x/server.crt&key=/y/server.key']);
# Or even a custom certificate authority
$daemon->listen(
['https://*:3000?cert=/x/server.crt&key=/y/server.key&ca=/z/ca.crt']);