Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I thought that will work, but not worked
use HTTP::Server::Simple::PSGI; my $app = sub { my $env = shift; return sub { my $responder = shift; my $writer = $responder->([ 200, [ 'Content-Type' => 'text/pla +in' ]]); my $n = 0; $writer->write($n); $n++; sleep 1; $writer->write($n); $n++; sleep 1; $writer->write($n); $n++; sleep 1; $writer->write($n); $n++; }; }; my $server = HTTP::Server::Simple::PSGI->new('8080'); $server->app($app); $server->host('127.0.0.1'); $server->run();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PSGI server push how to?
by Corion (Patriarch) on Jun 09, 2015 at 14:05 UTC |