Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a .NET FastCGI library?

Tags:

.net

fastcgi

I'm developing a small server that is supposed to interface via http. As I want it to be usable with different mature http servers, I have chosen FastCGI as the common interface.

Now I can't find a (free) .NET library that implements the FCGI interface and does all the hard work for me. Do you know one?

like image 578
Milan Avatar asked Jun 19 '10 14:06

Milan


3 Answers

See Mono.WebServer.FastCGI at
https://github.com/mono/xsp/tree/master/src

There's also a FastCGI CLIENT here:
http://sourceforge.net/projects/fcgidotnet/

And the FastCGI specification is here:
http://www.fastcgi.com/devkit/doc/fcgi-spec.html

You can find a OWIN compliant implementation here:
https://github.com/mzabani/Fos

Additionally, these libraries are also interesting:


HyperFastCGI:
https://github.com/xplicit/HyperFastCgi

or
https://github.com/gigi81/sharpfastcgi

or #cgi
https://github.com/wmeyer/SharpCGI

If you need more examples on FastCGI CLIENTs, you can have a look at this go library

https://github.com/tomasen/fcgi_client

like image 65
Stefan Steiger Avatar answered Oct 02 '22 21:10

Stefan Steiger


Not that I am aware of (I'm also looking)

One of the difficulties lies in the fact that FastCGI seems to require that you pass a handle to a listener socket to a child process in place of the normal StdIn handle - something which the standard .Net classes (Process, Socket etc...) don't allow. This means implementing a FastCGI library in .Net ultimately requires re-implementing the Process and Socket classes using P/Invoke calls to native Windows functions.

like image 40
Justin Avatar answered Oct 02 '22 20:10

Justin


I recently implemented such a library in F#: SharpCGI

Also completely usable from C#.

The problem Kragen describes is solved with some Win32 hackery, exploiting .NET internals. However, you don't have to use that if you configure your web server to use a designated port for FastCGI instead.

like image 21
wmeyer Avatar answered Oct 02 '22 22:10

wmeyer