fcgi

package
v0.0.0-...-4685c53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package fcgi implements the FastCGI protocol.

See https://fast-cgi.github.io/ for an unofficial mirror of the original documentation.

Currently only the responder role is supported.

Index

Constants

This section is empty.

Variables

View Source
var ErrConnClosed = errors.New("fcgi: connection to web server closed")

ErrConnClosed is returned by Read when a handler attempts to read the body of a request after the connection to the web server has been closed.

View Source
var ErrRequestAborted = errors.New("fcgi: request aborted by web server")

ErrRequestAborted is returned by Read when a handler attempts to read the body of a request that has been aborted by the web server.

Functions

func ProcessEnv

func ProcessEnv(r *http.Request) map[string]string

ProcessEnv returns FastCGI environment variables associated with the request r for which no effort was made to be included in the request itself - the data is hidden in the request's context. As an example, if REMOTE_USER is set for a request, it will not be found anywhere in r, but it will be included in ProcessEnv's response (via r's context).

func Serve

func Serve(l net.Listener, handler http.Handler) error

Serve accepts incoming FastCGI connections on the listener l, creating a new goroutine for each. The goroutine reads requests and then calls handler to reply to them. If l is nil, Serve accepts connections from os.Stdin. If handler is nil, http.DefaultServeMux is used.

Types

type Server

type Server struct {
	// Network and Addr is the address or path to the socket, which
	// are used to create the listener
	Network, Addr string

	// handler to invoke, http.DefaultServeMux if nil
	Handler http.Handler
	// contains filtered or unexported fields
}

A Server defines parameters for running an FCGI server. The zero value for Server is a valid configuration, which responds to requests over stdin

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL