summaryrefslogtreecommitdiff
path: root/doc/modules
diff options
context:
space:
mode:
authorRyan Williams <breath@alum.mit.edu>2010-09-17 01:47:53 -0700
committerRyan Williams <breath@alum.mit.edu>2010-09-17 01:47:53 -0700
commit323bfcc1fe656bd2824f8d5d04fa6d5a474e0f8f (patch)
tree2782ba8ebb9e0628daccbae9e09629b1bf7308af /doc/modules
parentdc70cc38123326a916203c513daa0a1b35b15fdf (diff)
downloadeventlet-323bfcc1fe656bd2824f8d5d04fa6d5a474e0f8f.tar.gz
Documenting ssl servers.
Diffstat (limited to 'doc/modules')
-rw-r--r--doc/modules/websocket.rst7
-rw-r--r--doc/modules/wsgi.rst27
2 files changed, 24 insertions, 10 deletions
diff --git a/doc/modules/websocket.rst b/doc/modules/websocket.rst
index 78660cd..7405e8c 100644
--- a/doc/modules/websocket.rst
+++ b/doc/modules/websocket.rst
@@ -22,9 +22,10 @@ To create a websocket server, simply decorate a handler method with
You can find a slightly more elaborate version of this code in the file
``examples/websocket.py``.
-**Note** that the web socket spec is still under development, and it
-will be necessary to change the way that this module works in response
-to spec changes.
+As of version 0.9.13, eventlet.websocket supports SSL websockets; all that's necessary is to use an :ref:`SSL wsgi server <wsgi_ssl>`.
+
+.. note :: The web socket spec is still under development, and it will be necessary to change the way that this module works in response to spec changes.
+
.. automodule:: eventlet.websocket
:members:
diff --git a/doc/modules/wsgi.rst b/doc/modules/wsgi.rst
index a37d35a..401ea99 100644
--- a/doc/modules/wsgi.rst
+++ b/doc/modules/wsgi.rst
@@ -1,7 +1,7 @@
:mod:`wsgi` -- WSGI server
===========================
-The wsgi module provides a simple an easy way to start an event-driven
+The wsgi module provides a simple and easy way to start an event-driven
`WSGI <http://wsgi.org/wsgi/>`_ server. This can serve as an embedded
web server in an application, or as the basis for a more full-featured web
server package. One such package is `Spawning <http://pypi.python.org/pypi/Spawning/>`_.
@@ -21,6 +21,25 @@ To launch a wsgi server, simply create a socket and call :func:`eventlet.wsgi.se
You can find a slightly more elaborate version of this code in the file
``examples/wsgi.py``.
+.. automodule:: eventlet.wsgi
+ :members:
+
+.. _wsgi_ssl:
+
+SSL
+---
+
+Creating a secure server is only slightly more involved than the base example. All that's needed is to pass an SSL-wrapped socket to the :func:`~eventlet.wsgi.server` method::
+
+ wsgi.server(eventlet.wrap_ssl(eventlet.listen(('', 8090)),
+ certfile='cert.crt',
+ keyfile='private.key',
+ server_side=True),
+ hello_world)
+
+Applications can detect whether they are inside a secure server by the value of the ``env['wsgi.url_scheme']`` environment variable.
+
+
Non-Standard Extension to Support Post Hooks
--------------------------------------------
Eventlet's WSGI server supports a non-standard extension to the WSGI
@@ -53,9 +72,3 @@ Post hooks are useful when code needs to be executed after a response has been
fully sent to the client (or when the client disconnects early). One example is
for more accurate logging of bandwidth used, as client disconnects use less
bandwidth than the actual Content-Length.
-
-API
----
-
-.. automodule:: eventlet.wsgi
- :members: