Plack::Handler::Net::Async::HTTP::Server - HTTP handler for Plack using Net::Async::HTTP::Server
Plack::Handler::Net::Async::HTTP::Server
use Plack::Handler::Net::Async::HTTP::Server; my $handler = Plack::Handler::Net::Async::HTTP::Server->new( listen => [ ":8080" ], ); sub psgi_app { ... } $handler->run( \&psgi_app );
This module allows Plack to run a PSGI application as a standalone HTTP daemon under IO::Async, by using Net::Async::HTTP::Server.
plackup -s Net::Async::HTTP::Server --listen ":8080" application.psgi
This is internally implemented using Net::Async::HTTP::Server::PSGI; further information on environment etc.. is documented there.
If IO::Async::SSL is available, this handler supports accepting connections via https
https
plackup -s Net::Async::HTTP::Server --ssl ...
Or per-listen argument by appending :SSL, as
:SSL
plackup -s Net::Async::HTTP::Server --listen ":8443:SSL" ...
Any other options whose names start ssl_ will be passed on to the SSL listen method.
ssl_
Returns a new instance of a Plack::Handler::Net::Async::HTTP::Server object. Takes the following named arguments:
Reference to an array containing listen string specifications. Each string gives a port number and optional hostname, given as :port or host:port.
:port
host:port
Reference to code to invoke when the server is set up and listening, ready to accept connections. It is invoked with a HASH reference containing the following details:
$server_ready->( { host => HOST, port => SERVICE, server_software => NAME, } )
Gives a UNIX socket path to listen on, instead of a TCP socket.
Optional. If provided, sets the listen() queue size for creating listening sockets. If missing, a default of 10 is used.
listen()
Creates the HTTP-listening socket or sockets, and runs the given PSGI application for received requests.
Net::Async::HTTP::Server - serve HTTP with IO::Async
Plack - Perl Superglue for Web frameworks and Web Servers (PSGI toolkit)
Paul Evans <leonerd@leonerd.org.uk>
To install Net::Async::HTTP::Server, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Async::HTTP::Server
CPAN shell
perl -MCPAN -e shell install Net::Async::HTTP::Server
For more information on module installation, please visit the detailed CPAN module installation guide.