Lazcano
Lazcano

Reputation: 37

Python Tornado - TCPServer and Application

I set up a tornado.tcpserver.TCPServer which uses H2, to get HTTP2 working. Now i face following issue: I can't create routes and it looks like there's no way to bind Tornado.web with Tornado.tcpserver...

AFAIK tornado.web.Application works only with tornado.httpserver.HTTPServer :/ But Tornado still doesn't support HTTP2, so using tornado.httpserver is absolutely a no-go from me -_-

Does anyone know a workaround or function which allows us to bind tornado.web.Application with tornado.tcpserver.TCPServer?

Upvotes: 0

Views: 256

Answers (1)

Ben Darnell
Ben Darnell

Reputation: 22134

tornado.web.Application implements the HTTPServerConnectionDelegate interface. To use it from another server, call start_request and pass the http headers and other data from your server implementation to the returned HTTPMessageDelegate.

There's also a native tornado implementation of HTTP/2 in https://github.com/bdarnell/tornado_http2

Upvotes: 1

Related Questions