-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
The current library presume library-users are working on a proxy to application server (as described in the FastCGI specification). But some library (e.g. https://github.com/tomasen/fcgi_client) works as a simple request-response interface for the application server.
gofast should also support this.
Conceptually, it should probably look like this
...
address := os.Getenv("FASTCGI_ADDR")
// A client to directly connect FCGI backend
f := gofast.SimpleClientFactory(gofast.SimpleConnFactory("tcp", address), 0)
client := gofast.NewDirectClient(f, ...)
// Request specifying "SCRIPT_FILENAME" and
// a small subset of usual header by default
// (user can supply more parameters)
req := gofast.NewDirectRequest(...)
// make the direct request
var resp http.Response := client.Do(req)
...
...Connections are closed by the end of every session. Should be pretty straightforward to use.
harai