Skip to content

Instantly share code, notes, and snippets.

@anandology
Created May 29, 2009 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandology/119795 to your computer and use it in GitHub Desktop.
Save anandology/119795 to your computer and use it in GitHub Desktop.
"""web frontend for fastcgi process.
Usage:
python fcgi_server.py socket-file
"""
from web.wsgiserver import CherryPyWSGIServer
from flup.client.fcgi_app import FCGIApp
server_address = ("0.0.0.0", 8080)
def main(socket):
app = FCGIApp(connect=socket)
server = CherryPyWSGIServer(server_address, app)
print "http://%s:%d/" % server_address
try:
server.start()
except KeyboardInterrupt:
server.stop()
if __name__ == "__main__":
import sys
main(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment