CherryPyWSGIServer

An HTTP server for WSGI.

bind_addr: a (host, port) tuple if TCP sockets are desired;
for UNIX sockets, supply the filename as a string.
wsgi_app: the WSGI 'application callable'; multiple WSGI applications
may be passed as (script_name, callable) pairs.

System Message: WARNING/2 (paste.script.wsgiserver.CherryPyWSGIServer, line 5)

Definition list ends without a blank line; unexpected unindent.

numthreads: the number of worker threads to create (default 10). server_name: the string to set for WSGI's SERVER_NAME environ entry.

System Message: ERROR/3 (paste.script.wsgiserver.CherryPyWSGIServer, line 7)

Unexpected indentation.
Defaults to socket.gethostname().

System Message: WARNING/2 (paste.script.wsgiserver.CherryPyWSGIServer, line 8)

Block quote ends without a blank line; unexpected unindent.

max: the maximum number of queued requests (defaults to -1 = no limit). request_queue_size: the 'backlog' argument to socket.listen();

System Message: ERROR/3 (paste.script.wsgiserver.CherryPyWSGIServer, line 10)

Unexpected indentation.
specifies the maximum number of queued connections (default 5).

System Message: WARNING/2 (paste.script.wsgiserver.CherryPyWSGIServer, line 11)

Block quote ends without a blank line; unexpected unindent.

timeout: the timeout in seconds for accepted connections (default 10).

protocol: the version string to write in the Status-Line of all
HTTP responses. For example, "HTTP/1.1" (the default). This also limits the supported features used in the response.

SSL/HTTPS

The OpenSSL module must be importable for SSL functionality. You can obtain it from http://pyopenssl.sourceforge.net/

ssl_certificate: the filename of the server SSL certificate. ssl_privatekey: the filename of the server's private key file.

If either of these is None (both are None by default), this server will not use SSL. If both are given and are valid, they will be read on server start and used in the SSL context for the listening socket.


Attributes

a interrupt

Set this to an Exception instance to interrupt the server.

a protocol

'HTTP/1.1'

a ready

False

a ssl_certificate

None

a ssl_private_key

None

a version

'CherryPy/3.0.2'

Methods

f __init__(self, bind_addr, wsgi_app, numthreads=10, server_name=None, max=-1, request_queue_size=5, timeout=10) ...

f start(self) ...

Run the server forever.

f bind(self, family, type, proto=0) ...

Create (or recreate) the actual socket object.

f tick(self) ...

Accept a new connection and put it on the Queue.

f stop(self) ...

Gracefully shutdown a server that is serving forever.

f populate_ssl_environ(self) ...

Create WSGI environ entries to be merged into each request.

See the source for more information.