Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 440308a044
Fetching contributors…

Cannot retrieve contributors at this time

202 lines (155 sloc) 16.756 kB
<html>
<head>
<meta equiv="Cotent-Type" content="text/html;charset=utf-8"/>
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://blog.plackperl.org/atom.xml" />
<title>PSGI/Plack - Perl Superglue for Web Frameworks and Web Servers</title>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-52226-5");
pageTracker._trackPageview();
} catch(err) {}</script>
<link rel="stylesheet" href="http://plackperl.org/screen.css"/>
<style>
body { font-size: 1.0em; background: #fff }
a, a:hover { color: #000 }
h1 { font-size: 3em; margin-bottom: 0 }
p.tagline { color: #888; padding-bottom: 2em; font-size: 0.9em }
p.quote { padding-bottom: 0 }
p.quoted { text-align: right; padding: 0; font-style: italic; padding-bottom: 1em; font-size: 0.8em }
pre.code { background: #222; color: #ddd; font-size: 1.2em; padding: 1em }
</style>
</head>
<body>
<div class="container">
<h1>PSGI/Plack</h1>
<p class="tagline">Superglue interface between perl web application frameworks and web servers, just like Perl is the duct tape of the internet.</p>
<p>PSGI is an <strong>interface</strong> between Perl web applications and web servers, and Plack is a Perl module and <strong>toolkit</strong> that contains PSGI middleware, helpers and adapters to web servers.</p>
<p>PSGI and Plack are inspired by Python's <a href="http://www.python.org/dev/peps/pep-0333/">WSGI</a> and Ruby's <a href="http://rack.rubyforge.org/">Rack</a>.</p>
<h2 id="documentation">Documentation</h2>
<ul>
<li><a href="http://search.cpan.org/perldoc?PSGI">PSGI specification</a></li>
<li><a href="http://search.cpan.org/perldoc?PSGI::FAQ">Frequently Asked Questions</a></li>
<li><a href="http://search.cpan.org/perldoc?Plack">Plack documentation</a></li>
</ul>
<h2 id="installation">Get Started</h2>
<p class="inline">Install <a href="http://search.cpan.org/perldoc?App::cpanminus#INSTALL">cpanminus</a> and then run the following command to install Plack and uility modules.</p>
<pre class="code">$ cpanm Task::Plack</pre>
<h2 id="testimonials">What People Say</h2>
<p class="quote">&quot;I love this... I think it's exactly the right answer to what I was looking for, for a really simple webapp.&quot;</p><p class="quoted">-Benjamin Trott, CTO and Co-founder of Six Apart</p>
<p class="quote">&quot;Wow, this is nothing short of awesome. A big ++ to the entire PSGI/Plack team!&quot</p><p class="quoted">-Stevan Little, Infinity Interactive, Moose author</p>
<p class="quote">&quot;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&quot;</p><p class="quoted">-Yuval Kogman, Infinity Interactive, KiokuDB developer</p>
<p class="quote">&quot;PSGI (is) an absurdly simple, manifestly beautiful specification for an interface between Perl web apps and web servers.&quot; </p><p class="quoted">-Patrick Donelan, WebGUI developer</p>
<p class="quote">&quot;Thanks for including us! We're very excited about a future where we don't have to worry about web server support&quot;</p><p class="quoted">-Jonathan Swartz, Mason author</p>
<p class="quote">&quot;I \N{HEAVY BLACK HEART} PSGI.&quot;</p><p class="quoted">-Simon Cozens, the author of Advanced Perl Programming</p>
<p class="quote">&quot;miyagawa++ # fucking awesome&quot;</p><p class="quoted">-Matt S Trout, Shadowcat Systems, Catalyst and DBIx::Class developer</p>
<h2 id="repositories">Repositories</h2>
<ul>
<li><a href="http://github.com/miyagawa/psgi-specs">PSGI specifications</a></li>
<li><a href="http://github.com/miyagawa/Plack">Plack core</a></li>
</ul>
<h2 id="servers">Servers</h2>
<dl>
<dt><a href="http://search.cpan.org/dist/Plack">Plack</a> (web server adapters)</dt>
<dd>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.</dd>
<dt><a href="http://search.cpan.org/dist/Plack">HTTP::Server::PSGI</a></dt>
<dd>HTTP::Server::PSGI is a reference PSGI standalone web server implementation and is included in the Plack core distribution.</dd>
<dt><a href="http://search.cpan.org/dist/HTTP-Server-Simple-PSGI">HTTP::Server::Simple::PSGI</a></dt>
<dd>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.</dd>
<dt><a href="http://github.com/miyagawa/Starman">Starman</a></dt>
<dd>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.</dd>
<dt><a href="http://github.com/miyagawa/Twiggy">Twiggy</a></dt>
<dd>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 <a href="http://github.com/miyagawa/Tatsumaki">Tatsumaki</a> framework.</dd>
<dt><a href="http://github.com/miyagawa/Corona">Corona</a></dt>
<dd>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</dd>
<dt><a href="http://github.com/kazuho/Starlet">Starlet</a></dt>
<dd>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. This software was formerly called PSSPSS.</dd>
<dt>Misc. HTTP server adapters</dt>
<dd>There are many Perl web servers and adapters on CPAN and Plack handlers for them, to run PSGI applications on <a href="http://github.com/mala/Plack-Server-FCGI-EV">FCGI::EV</a>, <a href="http://github.com/typester/Plack-Server-Danga-Socket">Danga::Socket</a>, <a href="http://github.com/miyagawa/Plack-Handler-AnyEvent-HTTPD">AnyEvent::HTTPD</a>, <a href="http://github.com/miyagawa/Plack-Handler-SCGI">SCGI</a>, <a href="http://github.com/miyagawa/Plack-Handler-AnyEvent-SCGI">AnyEvent::SCGI</a> and <a href="http://github.com/frodwith/plack-server-poe">POE</a>. They are available as separate distributions.</dd>
<dt><a href="http://search.cpan.org/dist/Plack-Server-ReverseHTTP">ReverseHTTP</a></dt>
<dd>ReverseHTTP server allows you to run a PSGI application on your desktop or inside the firewall but allows external access via <a href="http://www.reversehttp.net/">reversehttp.net</a> gateway.</dd>
<dt><a href="http://projects.unbit.it/uwsgi/">uWSGI</a></dt>
<dd>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.</dd>
<dt><a href="http://github.com/spiritloose/mod_psgi/">mod_psgi</a></dt>
<dd>mod_psgi is an Apache2 module that runs PSGI applications using an embedded Perl interpreter. Developed by Jiro Nishiguchi</dd>
<dt><a href="http://github.com/sekimura/evpsgi">evpsgi</a></dt>
<dd>evpsgi is an <a href="http://monkey.org/~provos/libevent/doxygen/evhttp_8h.html">evhttp</a> based http server that runs PSGI applications with the embedded Perl interpreter. Developed by Masayoshi Sekimura</dd>
<dt><a href="http://www.danga.com/perlbal/">Perlbal</a></dt>
<dd><a href="http://github.com/miyagawa/Perlbal-Plugin-PSGI">Perlbal::Plugin::PSGI</a> 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 <strong>not supposed to block</strong>. 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.</dd>
<dt><a href="http://www.nginx.eu/">nginx embedded perl</a></dt>
<dd><a href="http://github.com/yappo/nginx-psgi-patchs">Kazuhiro Osawa's nginx patches</a> allows you to run PSGI applications on a Perl interpreter embedded <strong>inside</strong> nginx. This patch is considered <strong>highly experimental and not recommended</strong> 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.</dd>
<!-- dt><a href="http://github.com/tokuhirom/p5-http-server-fast/">HTTP::Server::Fast</a></dt>
<dd>HTTP::Server::Fast is a complete XS-based HTTP daemon to run PSGI applications, written by Tokuhiro Matsuno.</dd -->
</dl>
<h2 id="frameworks">Frameworks</h2>
<dl>
<dt><a href="http://www.catalystframework.org/">Catalyst</a></dt>
<dd>Catalyst is one of the most popular web application frameworks in Perl and has a support for PSGI through <a href="http://search.cpan.org/dist/Catalyst-Engine-PSGI">Catalyst::Engine::PSGI</a>. There's also <a href="http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/5.80/branches/psgi/">psgi branch</a> on Catalyst core to use PSGI by default.</dd>
<dt><a href="http://jifty.org/">Jifty</a></dt>
<dd>Jifty is a full-stack Perl web application framework that comes with continuations, form-based dispatch, ORM and A Pony. Jifty has replaced much of its internals with Plack modules.</dd>
<dt><a href="http://cgi-app.org/">CGI::Application</a></dt>
<dd>CGI::Application is a CGI.pm-based lightweight web framework. Any CGI::Application based applications can run as a PSGI application using <a href="http://search.cpan.org/dist/CGI-PSGI">CGI::PSGI</a> and <a href="http://search.cpan.org/dist/CGI-Application-PSGI">CGI::Application::PSGI</a>.</dd>
<dt><a href="http://search.cpan.org/dist/HTTP-Engine">HTTP::Engine</a></dt>
<dd>HTTP::Engine is a micro web application framework and is a &quot;father of PSGI/Plack&quot; since we owe lots of code and ideas. HTTP::Engine itself now has PSGI Interface support as an adapter since 0.03 on CPAN.</dd>
<dt><a href="http://dancer.sukria.net">Dancer</a></dt>
<dd>Dancer is a Sinatra-like micro web application framework and has supported PSGI since version 0.9904.</dd>
<dt><a href="http://www.masonhq.com/">Mason</a></dt>
<dd>Mason allows you to embed code in HTML templates and can now run on any PSGI supported web server using <a href="http://search.cpan.org/dist/HTML-Mason-PSGIHandler/">HTML::Mason::PSGIHandler</a></dd>
<dt><a href="http://search.cpan.org/~beppu/Squatting/">Squatting</a></dt>
<dd>Squatting is a Camping-inspired Web Microframework and has a support for PSGI through <a href="http://search.cpan.org/dist/Squatting-On-PSGI">Squatting::On::PSGI</a>.</dd>
<dt><a href="http://search.cpan.org/~awwaiid/Continuity/">Continuity</a></dt>
<dd>Continuity is a Coro based web application libary that supports Continuations to build statefull applications and support PSGI via Coro server since version 1.1.1 on CPAN.</dd>
<dt><a href="http://maypole.perl.org/">Maypole</a></dt>
<dd>Maypole is a Struts-inspired MVC web application frameworks built on top of Class::DBI ORM. Maypole applications can run as PSGI applications using <a href="http://github.com/miyagawa/Maypole-PSGI">Maypole::PSGI</a>.</dd>
<dt><a href="http://github.com/miyagawa/Tatsumaki">Tatsumaki</a></dt>
<dd>Tatsumaki is a web application framework built on top of Plack and AnyEvent: natively supports non-blocking I/O through psgi.streaming and psgi.nonblocking, non-blocking HTTP clients, long-poll Comet services and server push.</dd>
<dt><a href="http://mojolicious.org/">Mojolicious</a></dt>
<dd>Mojolicious is Merb and Sinatra inspired web framework and has zero dependencies to non-core Perl modules. It has a native PSGI adapter since 0.999920 on CPAN.</dd>
<dt>Other frameworks</dt>
<dd>There are lots of other individual frameworks that supports PSGI and Plack. Some of them are not available on CPAN but are developed on github: <a href="http://search.cpan.org/dist/Web-Simple">Web::Simple</a>, <a href="http://github.com/dann/angelos">Angelos</a>, <a href="http://github.com/typester/ark-perl">Ark</a>, <a href="http://github.com/spiritloose/Schenker">Schenker</a>, <a href="http://github.com/yusukebe/Noe">Noe</a>, <a href="http://github.com/nekokak/p5-Kamui">Kamui</a> and <a href="http://github.com/zby/WebNano">WebNano</a>.</dd>
<h2 id="applications">Applications</h2>
<dl>
<dt><a href="http://www.webgui.org/">WebGUI</a></dt>
<dd><a href="http://blog.patspam.com/">Patrick Donelan</a> is working on <a href="http://blog.patspam.com/2009/plebgui-webgui-meets-plack">Plack support for WebGUI</a> on <a href="http://github.com/pdonelan/webgui">his github repo</a>.</dd>
</dl>
<h2 id="middlewares">Middleware and Utilities</h2>
<dl>
<dt><a href="http://search.cpan.org/dist/CGI-PSGI">CGI::PSGI</a></dt>
<dd>CGI.pm subclass to handle PSGI env hash to provide a CGI.pm-compatible interface. Very useful to migrate CGI.pm-based web application frameworks to the PSGI interface.</dd>
<dt><a href="http://search.cpan.org/perldoc?Plack::Request">Plack::Request</a></dt>
<dd>Plack::Request and Plack::Response is a simple wrapper around PSGI environment hash and response array to access those values using an Object oriented API.</dd>
<dt><a href="http://search.cpan.org/~nuffin/IO-Handle-Util/">IO::Handle::Util</a></dt>
<dd>Utility module to create an IO::Handle-like object instantly with a simple interface.</dd>
<dt><a href="http://search.cpan.org/~kazuho/HTTP-Parser-XS-0.02/">HTTP::Parser::XS</a></dt>
<dd>Super fast XS-based PSGI compatible HTTP header parser, used in many Plack server implementations.</dd>
<dt><a href="http://search.cpan.org/dist/CGI-Emulate-PSGI">CGI::Emulate::PSGI</a></dt>
<dd>Run any CGI scripts (whether it uses CGI.pm or not) as a PSGI application by emulating a CGI environment. It does the opposite of CGI runner PSGI server impementation (Plack::Server::CGI). Also take a look at <a href="http://search.cpan.org/dist/CGI-Compile">CGI::Compile</a> which compiles an existing CGI scripts into a callable subroutine reference, best to be used with CGI::Emulate::PSGI.</dd>
</dl>
<h2 id="slides">Slides and Blog Posts</h2>
<p class="inline">Note that some materials and technical details might be outdated.</p>
<dl>
<dt><a href="http://blog.plackperl.org/">Plack Blog</a></dt>
<dd>Reblogging blog posts about PSGI and Plack</dd>
<dt><a href="http://advent.plackperl.org/">Plack Advent Calendar</a></dt>
<dd>24 days of Tips and tricks for PSGI and Plack</dd>
<dt><a href="http://www.slideshare.net/miyagawa/plack-at-oscon-2010">Plack: Superglue for Perl web frameworks and servers</a><dt>
<dd>Tatsuhiko Miyagawa at O'Reilly OSCON, July 2010</dd>
<dt><a href="http://blog.patspam.com/2009/plebgui-webgui-meets-plack">PlebGUI: WebGUI meets Plack</a></dt>
<dd>Patrick Donelan writes a good introduction for PSGI and Plack from the web application developers point of view.</dd>
<dt><a href="http://www.simon-cozens.org/content/i-finally-get-psgi-and-plack">I finally get PSGI and Plack!</a></dt>
<dd>Simon Cozens writes a great post about what PSGI is, by comparing it with HTTP::Engine.</dd>
<dt><a href="http://www.slideshare.net/miyagawa/tatsumaki">Tatsumaki, Plack based non-blocking framework</a></dt>
<dd>Tatsuhiko Miyagawa explains psgi.streaming interface to enable asynchronous requests in web frameworks. Screencast in Japanese is also <a href="http://vimeo.com/7897566">available</a>.</dd>
<dt><a href="http://tokuhirom.github.com/talks/20090910-yapcasia2009-psgi-plack/">PSGI/Plack</a></dt>
<dd>Tokuhiro Matsuno and Tatsuhiko Miyagawa at YAPC::Asia 2009 (Japanese).</dd>
</dl>
<h2 id="community">Community</h2>
<p>Tatsuhiko Miyagawa's <a href="http://bulknews.typepad.com/">blog</a> and delicious bookmarks (<a href="http://delicious.com/miyagawa/psgi">PSGI</a> and <a href="http://delicious.com/miyagawa/plack">Plack</a>) have a lot of updated information and links to PSGI/Plack related entries. We're chatting on <a href="irc://irc.perl.org/#plack">#plack on irc.perl.org</a> and have a low-traffic <a href="http://groups.google.com/group/psgi-plack">mailing list</a>.
<div id="footer">
The PSGI spec and Plack are written by <a href="http://bulknews.typepad.com/">Tatsuhiko Miyagawa</a> and many contributors.<br/>Source code for this site is available on <a href="http://github.com/miyagawa/plackperl.org">github</a>.
</div>
</div>
</body>
Jump to Line
Something went wrong with that request. Please try again.