1 # Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 package PublicInbox::HTTPD;
8 require PublicInbox::HTTPD::Async;
9 require PublicInbox::Daemon;
11 sub pi_httpd_async { PublicInbox::HTTPD::Async->new(@_) }
14 my ($class, $sock, $app) = @_;
15 my $n = getsockname($sock) or die "not a socket: $sock $!\n";
16 my ($host, $port) = PublicInbox::Daemon::host_with_port($n);
22 'psgi.version' => [ 1, 1 ],
23 'psgi.errors' => \*STDERR,
24 'psgi.url_scheme' => 'http',
25 'psgi.nonblocking' => Plack::Util::TRUE,
26 'psgi.streaming' => Plack::Util::TRUE,
27 'psgi.run_once' => Plack::Util::FALSE,
28 'psgi.multithread' => Plack::Util::FALSE,
29 'psgi.multiprocess' => Plack::Util::TRUE,
30 'psgix.harakiri'=> Plack::Util::FALSE,
31 'psgix.input.buffered' => Plack::Util::TRUE,
34 'pi-httpd.async' => do {