.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mojo::Server::FastCGI 3pm" .TH Mojo::Server::FastCGI 3pm "2021-01-01" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mojo::Server::FastCGI \- FastCGI Server .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Mojo::Server::FastCGI; \& \& my $fcgi = Mojo::Server::FastCGI\->new; \& $fcgi\->on_request(sub { \& my ($self, $tx) = @_; \& \& # Request \& my $method = $tx\->req\->method; \& my $path = $tx\->req\->url\->path; \& \& # Response \& $tx\->res\->code(200); \& $tx\->res\->headers\->content_type(\*(Aqtext/plain\*(Aq); \& $tx\->res\->body("$method request for $path!"); \& \& # Resume transaction \& $tx\->resume; \& }); \& $fcgi\->run; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Mojo::Server::FastCGI is a portable pure-Perl FastCGI implementation as described in the \f(CW\*(C`FastCGI Specification\*(C'\fR. .PP See Mojolicious::Guides::Cookbook for deployment recipes. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" Mojo::Server::FastCGI inherits all attributes from Mojo::Server. .SH "METHODS" .IX Header "METHODS" Mojo::Server::FastCGI inherits all methods from Mojo::Server and implements the following new ones. .ie n .SS """accept_connection""" .el .SS "\f(CWaccept_connection\fP" .IX Subsection "accept_connection" .Vb 1 \& my $c = $fcgi\->accept_connection; .Ve .PP Accept FastCGI connection. .ie n .SS """read_record""" .el .SS "\f(CWread_record\fP" .IX Subsection "read_record" .Vb 1 \& my ($type, $id, $body) = $fcgi\->read_record($c); .Ve .PP Parse FastCGI record. .ie n .SS """read_request""" .el .SS "\f(CWread_request\fP" .IX Subsection "read_request" .Vb 1 \& my $tx = $fcgi\->read_request($c); .Ve .PP Parse FastCGI request. .ie n .SS """role_name""" .el .SS "\f(CWrole_name\fP" .IX Subsection "role_name" .Vb 1 \& my $name = $fcgi\->role_name(3); .Ve .PP FastCGI role name. .ie n .SS """role_number""" .el .SS "\f(CWrole_number\fP" .IX Subsection "role_number" .Vb 1 \& my $number = $fcgi\->role_number(\*(AqFILTER\*(Aq); .Ve .PP FastCGI role number. .ie n .SS """run""" .el .SS "\f(CWrun\fP" .IX Subsection "run" .Vb 1 \& $fcgi\->run; .Ve .PP Start FastCGI. .ie n .SS """type_name""" .el .SS "\f(CWtype_name\fP" .IX Subsection "type_name" .Vb 1 \& my $name = $fcgi\->type_name(5); .Ve .PP FastCGI type name. .ie n .SS """type_number""" .el .SS "\f(CWtype_number\fP" .IX Subsection "type_number" .Vb 1 \& my $number = $fcgi\->type_number(\*(AqSTDIN\*(Aq); .Ve .PP FastCGI type number. .ie n .SS """write_records""" .el .SS "\f(CWwrite_records\fP" .IX Subsection "write_records" .Vb 1 \& $fcgi\->write_record($c, \*(AqSTDOUT\*(Aq, $id, \*(AqHTTP/1.1 200 OK\*(Aq); .Ve .PP Write FastCGI record. .ie n .SS """write_response""" .el .SS "\f(CWwrite_response\fP" .IX Subsection "write_response" .Vb 1 \& $fcgi\->write_response($tx); .Ve .PP Write FastCGI response. .SH "DEBUGGING" .IX Header "DEBUGGING" You can set the \f(CW\*(C`MOJO_FASTCGI_DEBUG\*(C'\fR environment variable to get some advanced diagnostics information sent to the Mojo logger as \f(CW\*(C`debug\*(C'\fR messages. .PP .Vb 1 \& MOJO_FASTCGI_DEBUG=1 .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Mojolicious, Mojolicious::Guides, .