diff options
author | Bert JW Regeer <bertjw@regeer.org> | 2016-08-31 22:35:22 -0600 |
---|---|---|
committer | Bert JW Regeer <bertjw@regeer.org> | 2016-08-31 22:42:57 -0600 |
commit | d641154314545f72477801040f61e4afdef44af3 (patch) | |
tree | 8f31f8bad510557a5774ee860046dd3ccc33b2e3 | |
parent | 4600af04ffc287d8b8f3e44413059be7cfaca5ac (diff) | |
download | waitress-d641154314545f72477801040f61e4afdef44af3.tar.gz |
remove deprecation of host/port
-rw-r--r-- | docs/arguments.rst | 4 | ||||
-rw-r--r-- | docs/index.rst | 35 |
2 files changed, 33 insertions, 6 deletions
diff --git a/docs/arguments.rst b/docs/arguments.rst index d6d75ce..b827b0e 100644 --- a/docs/arguments.rst +++ b/docs/arguments.rst @@ -13,16 +13,12 @@ host .. warning:: May not be used with ``listen`` - .. deprecated:: 1.0 - port TCP port (integer) on which to listen, default ``8080`` .. warning:: May not be used with ``listen`` - .. deprecated:: 1.0 - listen Tell waitress to listen on an host/port combination. It is to be provided as a space delineated list of host/port: diff --git a/docs/index.rst b/docs/index.rst index 9d8a812..cd175e3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,6 +20,23 @@ Here's normal usage of the server: This will run waitress on port 8080 on all available IP addresses, both IPv4 and IPv6. + +.. code-block:: python + + from waitress impot serve + serve(wsgiapp, host='0.0.0.0', port=8080) + +This will run waitress on port 8080 on all available IPv4 addresses. + +If you want to serve your application on all IP addresses, on port 8080, you +can omit the ``host`` and ``port`` arguments and just call ``serve`` with the +WSGI app as a single argument: + +.. code-block:: python + + from waitress import serve + serve(wsgiapp) + Press Ctrl-C (or Ctrl-Break on Windows) to exit the server. The default is to bind to any IPv4 address on port 8080: @@ -52,6 +69,14 @@ lets you use Waitress's WSGI gateway from a configuration file, e.g.: use = egg:waitress#main listen = 127.0.0.1:8080 +Using ``host`` and ``port`` is also supported: + +.. code-block:: ini + + [server:main] + host = 127.0.0.1 + port = 8080 + The :term:`PasteDeploy` syntax for UNIX domain sockets is analagous: .. code-block:: ini @@ -65,9 +90,15 @@ equivalent settings in PasteDeploy) in :ref:`arguments`. Additionally, there is a command line runner called ``waitress-serve``, which can be used in development and in situations where the likes of -:term:`PasteDeploy` is not necessary:: +:term:`PasteDeploy` is not necessary: + +.. code-block:: bash + + # Listen on both IPv4 and IPv6 on port 8041 + waitress-serve --listen=*:8041 myapp:wsgifunc - waitress-serve --listen=*:8041 myapp:wsgifunc + # Listen on only IPv4 on port 8041 + waitress-serve --port=8041 myapp:wsgifunc For more information on this, see :ref:`runner`. |