diff options
| author | ianb <devnull@localhost> | 2005-05-14 17:53:39 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-14 17:53:39 +0000 |
| commit | e525435e71ad3d76bdc1786aabe2447c63bb4de4 (patch) | |
| tree | 7b618d8b5987fcab9ba8f31892dc9c916559ea07 /paste | |
| parent | 7bbc59af44b874a27c44a4e536fcc8b113c2b990 (diff) | |
| download | paste-e525435e71ad3d76bdc1786aabe2447c63bb4de4.tar.gz | |
Added flup SCGI servers
Diffstat (limited to 'paste')
| -rw-r--r-- | paste/servers/scgi_flup_fork_server.py | 12 | ||||
| -rw-r--r-- | paste/servers/scgi_threaded_server.py | 31 |
2 files changed, 43 insertions, 0 deletions
diff --git a/paste/servers/scgi_flup_fork_server.py b/paste/servers/scgi_flup_fork_server.py new file mode 100644 index 0000000..67d5e1e --- /dev/null +++ b/paste/servers/scgi_flup_fork_server.py @@ -0,0 +1,12 @@ +from scgi_threaded_server import * + +def serve(conf, app): + from flup.server.scgi_fork import WSGIServer + return serve_server(conf, app, WSGIServer) + +description = """\ +A SCGI forking (multiprocess) server. SCGI is a FastCGI alternative +(see <http://www.mems-exchange.org/software/scgi/> for more). This +server (unlike the 'scgi' server, which is also forking) is from flup: +<http://www.saddi.com/software/flup/>. +""" diff --git a/paste/servers/scgi_threaded_server.py b/paste/servers/scgi_threaded_server.py new file mode 100644 index 0000000..94c0ebf --- /dev/null +++ b/paste/servers/scgi_threaded_server.py @@ -0,0 +1,31 @@ +from paste.util import thirdparty +thirdparty.add_package('flup') +from paste import pyconfig + +def serve(conf, app): + from flup.server.scgi import WSGIServer + return serve_server(conf, app, WSGIServer) + +def serve_server(conf, app, server_class): + server = server_class( + app, + bindAddress=(conf.get('host', 'localhost'), + int(conf.get('port', '4000'))), + scriptName=conf.get('root_url', ''), + allowedServers=pyconfig.make_list(conf.get('allowed_servers', None))) + return server.run() + +options = [ + ('host', 'The host name to bind to (default localhost). Note, if binding to localhost, only local connections will be allowed.'), + ('port', 'The port to bind to (default 4000).'), + ('root_url', 'The URL level to expect for incoming connections; if not set and this is not bound to /, then SCRIPT_NAME and PATH_INFO may be incorrect.'), + ('allow_servers', 'A list of servers to allow connections from.'), + ] + +description = """\ +A SCGI multithreaded server. SCGI is a FastCGI alternative (see +<http://www.mems-exchange.org/software/scgi/> for more). This server +is from flup: <http://www.saddi.com/software/flup/>. +""" + +# @@: TODO: handle the logging level, or integrate logging |
