mirror of https://github.com/gin-gonic/gin.git
Add support for FCGI via net/http/fcgi
This commit is contained in:
parent
4cabdd303f
commit
ab554d7a93
11
gin.go
11
gin.go
|
@ -9,6 +9,7 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/http/fcgi"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -311,6 +312,16 @@ func (engine *Engine) Run(addr ...string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RunFCGI attaches the router to a fcgi.child and starts listening to os.Stdin for requests
|
||||||
|
// It is a shortcut for fcgi.Serve(nil, router)
|
||||||
|
func (engine *Engine) RunFCGI() (err error) {
|
||||||
|
defer func() { debugPrintError(err) }()
|
||||||
|
|
||||||
|
debugPrint("Listening and serving HTTP on FCGI\n")
|
||||||
|
err = fcgi.Serve(nil, engine)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// RunTLS attaches the router to a http.Server and starts listening and serving HTTPS (secure) requests.
|
// RunTLS attaches the router to a http.Server and starts listening and serving HTTPS (secure) requests.
|
||||||
// It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)
|
// It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)
|
||||||
// Note: this method will block the calling goroutine indefinitely unless an error happens.
|
// Note: this method will block the calling goroutine indefinitely unless an error happens.
|
||||||
|
|
Loading…
Reference in New Issue