GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOJO::SERVER::FASTCGI (3)

.ds Aq ’

NAME

Mojo::Server::FastCGI - FastCGI Server

CONTENTS

SYNOPSIS



  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(text/plain);
    $tx->res->body("$method request for $path!");

    # Resume transaction
    $tx->resume;
  });
  $fcgi->run;



DESCRIPTION

Mojo::Server::FastCGI is a portable pure-Perl FastCGI implementation as described in the FastCGI Specification.

See Mojolicious::Guides::Cookbook for deployment recipes.

ATTRIBUTES

Mojo::Server::FastCGI inherits all attributes from Mojo::Server.

METHODS

Mojo::Server::FastCGI inherits all methods from Mojo::Server and implements the following new ones.

CWaccept_connection



  my $c = $fcgi->accept_connection;



Accept FastCGI connection.

CWread_record



  my ($type, $id, $body) = $fcgi->read_record($c);



Parse FastCGI record.

CWread_request



  my $tx = $fcgi->read_request($c);



Parse FastCGI request.

CWrole_name



  my $name = $fcgi->role_name(3);



FastCGI role name.

CWrole_number



  my $number = $fcgi->role_number(FILTER);



FastCGI role number.

CWrun



  $fcgi->run;



Start FastCGI.

CWtype_name



  my $name = $fcgi->type_name(5);



FastCGI type name.

CWtype_number



  my $number = $fcgi->type_number(STDIN);



FastCGI type number.

CWwrite_records



  $fcgi->write_record($c, STDOUT, $id, HTTP/1.1 200 OK);



Write FastCGI record.

CWwrite_response



  $fcgi->write_response($tx);



Write FastCGI response.

DEBUGGING

You can set the MOJO_FASTCGI_DEBUG environment variable to get some advanced diagnostics information sent to the Mojo logger as debug messages.



  MOJO_FASTCGI_DEBUG=1



SEE ALSO

Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOJO::SERVER::FASTCGI (3) 2013-01-31

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.