python: Set NPN in HTTP2Server.__init__

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-25 21:25:31 +09:00
parent add07c4303
commit 911ffb24fa
1 changed files with 5 additions and 0 deletions

View File

@ -948,6 +948,11 @@ class HTTP2Server:
return _HTTP2Session(RequestHandlerClass) return _HTTP2Session(RequestHandlerClass)
self.loop = asyncio.get_event_loop() self.loop = asyncio.get_event_loop()
if ssl:
ssl.set_npn_protocols([cnghttp2.NGHTTP2_PROTO_VERSION_ID\
.decode('utf-8')])
coro = self.loop.create_server(session_factory, coro = self.loop.create_server(session_factory,
host=address[0], port=address[1], host=address[0], port=address[1],
ssl=ssl) ssl=ssl)