From ab89f52302371d13a0bc6d4bd5fa5989458bcee3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 15 Sep 2017 19:08:49 +0200 Subject: [PATCH] Daphne deployment doc updates --- docs/deploying.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/deploying.rst b/docs/deploying.rst index 95ba5d1..c041e41 100644 --- a/docs/deploying.rst +++ b/docs/deploying.rst @@ -190,6 +190,17 @@ scenario, it will eventually time out and give you a 503 error after 2 minutes; you can configure how long it waits with the ``--http-timeout`` command line argument. +With some browsers you may see errors regarding ``Sec-WebSocket-Protocol`` headers. You can set the allowed ws_protocols to match your client protocol like this:: + + CHANNELS_WS_PROTOCOLS = ["graphql-ws", ] + +In production you may start a daphne server without the runserver command. So you need to pass the ws-protocl directly:: + + daphne --ws-protocol "graphql-ws" --proxy-headers my_project.asgi:channel_layer + +Note: The daphne server binds to 127.0.0.1 by default. If you deploy this not locally, bind to your ip or to any ip:: + + daphne -b 0.0.0.0 -p 8000 --ws-protocol "graphql-ws" --proxy-headers my_project.asgi:channel_layer Deploying new versions of code ------------------------------