...

Package fcgi

import "net/http/fcgi"
概览
索引

概览 ▾

fcgi 包实现了FastCGI协议. 当前只提供了FastCGI的响应服务端。 这个协议定义文档是:http://www.fastcgi.com/drupal/node/6?q=node/22

变量

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.

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.

func Serve

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

Serve在l监听器中接受传递进来的FastCGI连接,为每个请求创建了一个新的goroutine。 goroutine读取请求,然后调用handler来回复。 如果l是nil,Serve会从os.Stdin接收连接。 如果handler是nil,默认使用http.DefaultServeMux。