The main difference is in how they "talk" to outside world. Built-in
gevent.wsgi.WSGIServer (and gevent.pywsgi.WSGIServer) uses HTTP-
protocol while gevent_fastcgi.server.FastCGIServer "talks" FastCGI
protocol, which was specifically designed for communication between
front-end and back-end servers unlike HTTP.
Also, gevent_fastcgi server allows to use non-WSGI request handlers,
i.e. it can be used without WSGI-stack. Following is example of simple
request handler:
def handler(request):
remote_user = request.environ.get('REMOTE_USER', 'stranger')
request.stdout.write('\r\n'.join((
'200 OK',
'Content-type: text/plain',
'',
'Hello, %s!' % (remote_user,),
)))
if __name__ == '__main__':
from gevent_fastcgi.server import FastCGIServer
FastCGIServer('/path/to/unix/socket', handler).serve_forever()
You can also take a look on proof-of-concept CGI-handler at
http://pastebin.com/8c14sSXR than could be used to serve legacy CGI-
scripts via FatsCGI protocol.
- Alex K