I would like to set up a persistent application server running on Mono that needs to be able to accept web requests and return some suitable response. It’s a simple task, and pretty much what FastCGI is for, but I can’t seem to find a FastCGI solution that is not glued together with ASP.NET.
To be extra clear: I am not interested in ASP.NET and do not want to use it or attempt to co-opt any part of the ASP.NET stack. All I really need is a way to interface with a webserver through FastCGI and I can figure out the rest.
While the Mono FastCGI implementation is always packaged with a ASP.NET server, I wrote the code in such a way that it can be used with any sort of server implementation. Here is a basic example that should work. Your request specific code goes in the
Processmethod and you can access FastCGI environment variables throughResponderRequest.GetParameter.To build this example, you can download all the CS files from https://github.com/mono/xsp/tree/master/src/Mono.WebServer.FastCgi and just exclude any files that don’t use the
Mono.FastCginamespace.