PSGI/Plack

Superglue interface between perl web application frameworks and web servers, just like Perl is the duct tape of the internet.

PSGI is an interface between Perl web applications and web servers, and Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers.

PSGI and Plack are inspired by Python's WSGI and Ruby's Rack.

Documentation

Get Started

Install cpanminus and then run the following command to install Plack and utility modules.

$ cpanm Plack

What People Say

"I love this... I think it's exactly the right answer to what I was looking for, for a really simple webapp."

-Benjamin Trott, CTO and Co-founder of Six Apart

"Wow, this is nothing short of awesome. A big ++ to the entire PSGI/Plack team!"

-Stevan Little, Infinity Interactive, Moose author

"This is something we've needed for a long time: a clean and simple way to respond to HTTP requests without the cruft of CGI"

-Yuval Kogman, Infinity Interactive, KiokuDB developer

"PSGI (is) an absurdly simple, manifestly beautiful specification for an interface between Perl web apps and web servers."

-Patrick Donelan, WebGUI developer

"Thanks for including us! We're very excited about a future where we don't have to worry about web server support"

-Jonathan Swartz, Mason author

"Today, I finished a sizable project to upgrade almost all of our web stuff to run on Plack. Having done that, everything is better!"

-Ricardo Signes, Perl 5 Pumpking

"I \N{HEAVY BLACK HEART} PSGI."

-Simon Cozens, the author of Advanced Perl Programming

"miyagawa++ # fucking awesome"

-Matt S Trout, Shadowcat Systems, Catalyst and DBIx::Class developer

Repositories

Servers

Plack (web server adapters) Plack core includes a CGI runner (for running any PSGI application as a CGI script), a FastCGI daemon and mod_perl handlers for Apache1 and 2. HTTP::Server::PSGI HTTP::Server::PSGI is a reference PSGI standalone web server implementation and is included in the Plack core distribution. HTTP::Server::Simple::PSGI HTTP::Server::Simple::PSGI is based on HTTP::Server::Simple and has zero dependency other than HTTP::Server::Simple, which itself doesn't have any dependencies. This is best for embedding to build a standalone web server or dependency free frameworks. Starman Starman is a high-performance, preforking and PSGI compatible HTTP server that has unique features such as HTTP/1.1 support, multiple interfaces support including UNIX domain sockets, graceful restarts and dynamic worker pool configuration via signals. Twiggy Twiggy is an AnyEvent based non-blocking (asynchronous) and lightweight PSGI web server. Best to run AnyEvent based web applications to implement long-poll, server push or WebSockets etc., such as the one built on top of the Tatsumaki framework. Corona Corona is a Coro based PSGI web server that supports coroutines (cooperative threads) for each socket and clients. Best to use with AnyEvent or Coro friendly non-blocking web applications such as Continuity or Tatsumaki framework Feersum Feersum is an HTTP server built on EV/libev. Feersum uses a single-threaded, event-based programming architecture to scale and can handle many concurrent connections efficiently in both CPU and RAM. Starlet Kazuho Oku's Starlet is based on the reference HTTP::Server::PSGI web server but adds a support for preforking, graceful restarts, shutdown and hot deploy via Server::Starter. Gazelle Gazelle is based on Starlet, but has added a lot of performance optimizations using C/XS-based modules as well as new Linux features such as accept4 or writev. Arriba Arriba is a preforking PSGI HTTP server based on Starman with added support for the SPDY protocol. Misc. HTTP server adapters There are many Perl web servers and adapters on CPAN and Plack handlers for them, to run PSGI applications on FCGI::EV, AnyEvent::FCGI, Danga::Socket, AnyEvent::HTTPD, SCGI, AnyEvent::SCGI and POE. They are available as separate distributions. ReverseHTTP ReverseHTTP server allows you to run a PSGI application on your desktop or inside the firewall but allows external access via reversehttp.net gateway. uWSGI uWSGI is a C based developer friendly WSGI server. From the 0.9.5 release it include a plugin technology to add support for other languages, which includes an embedded PSGI handler. mod_psgi mod_psgi is an Apache2 module that runs PSGI applications using an embedded Perl interpreter. Developed by Jiro Nishiguchi evpsgi evpsgi is an evhttp based http server that runs PSGI applications with the embedded Perl interpreter. Developed by Masayoshi Sekimura Perlbal Perlbal::Plugin::PSGI allows you to run PSGI applications on Perlbal. Note that because Perlbal runs in a non-blocking event loop (Danga::Socket), your application is also not supposed to block. If your application blocks (with database acesss or network I/O), do not use this plugin and instead run your PSGI application with the prefork Plack server and reverse proxy to the backend as usual. nginx embedded perl Kazuhiro Osawa's nginx patches allows you to run PSGI applications on a Perl interpreter embedded inside nginx. This patch is considered highly experimental and not recommended for the production use. You're recommended to run your (possibly blocking) PSGI application with prefork/fastcgi servers and put nginx in front, and in that case you don't need this patch.

Frameworks