From a925ce32cdc8e93a21f7447ceccc52199fc554f2 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 18 Mar 2017 12:10:20 -0700 Subject: [PATCH] Add in HTTP/2 support with right deps and log info --- daphne/server.py | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/daphne/server.py b/daphne/server.py index d561eec..7b171b2 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -4,6 +4,7 @@ import warnings from twisted.internet import reactor, defer from twisted.internet.endpoints import serverFromString from twisted.logger import globalLogBeginner, STDLibLogObserver +from twisted.web import http from .http_protocol import HTTPFactory @@ -84,6 +85,12 @@ class Server(object): else: globalLogBeginner.beginLoggingTo([STDLibLogObserver(__name__)]) + # Detect what Twisted features are enabled + if http.H2_ENABLED: + logger.info("HTTP/2 support enabled") + else: + logger.info("HTTP/2 support not enabled (install the http2 and tls Twisted extras)") + # Disabled deliberately for the moment as it's worse performing if "twisted" in self.channel_layer.extensions and False: logger.info("Using native Twisted mode on channel layer") diff --git a/setup.py b/setup.py index 5d3147c..2f96759 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup( include_package_data=True, install_requires=[ 'asgiref>=1.0.0', - 'twisted>=16.0', + 'twisted>=17.0', 'autobahn>=0.12', ], extras_require={