Skip to content

Lack a way to do simple request #38

@yookoala

Description

@yookoala

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions