Search code examples
pythondjangodjango-channelsdjango-channels-presence

How to set connection-timeout in django channel?


Django channels disconnect the client if it doesn't respond for few seconds. But I can't find where to set that time limit. i checked this issue. It says it will be configurable.But I can't find where to set that limit. thank you


Solution

  • I solved this by modifying daphne's code and reinstalling it.

    1. Download daphne source code from github

    2. Change ping_interval,ping_timeout in server.py as per your needs.Default is 20,30 (in seconds)

    3. Install daphne using pip install -e /path/to/daphne/(where setup.py is located) Thats all!

    `