Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2 support #1438

Open
dvirsky opened this issue May 5, 2015 · 41 comments
Open

HTTP/2 support #1438

dvirsky opened this issue May 5, 2015 · 41 comments
Labels

Comments

@dvirsky
Copy link

dvirsky commented May 5, 2015

It would be nice to see tornado implement http/2, not that AFAIK it's a standard.

@v3ss0n
Copy link

v3ss0n commented May 6, 2015

Need to wait a bit till that standard become stable. Right?

@bdarnell
Copy link
Member

bdarnell commented May 7, 2015

The standard isn't finalized, but it's close enough to work with. I have some work in progress at https://github.com/bdarnell/tornado_http2. It's in decent shape but it doesn't support flow control yet so it only works for small requests and responses.

@v3ss0n
Copy link

v3ss0n commented May 7, 2015

thats awesome!

@dvirsky
Copy link
Author

dvirsky commented May 7, 2015

@bdarnell that's great. do you need help with specific things? I don't know the standard too well but I've skimmed over it and I know the general idea.

@bdarnell
Copy link
Member

Not really. The last thing left is flow control but it doesn't really lend itself to being worked on in parallel.

@Garfielt
Copy link

Thanks, good job!!

@jsarenik
Copy link
Contributor

Any news here? I have read the other posts so as far as I understand it will be not done until the protocol is finalized.

@v3ss0n
Copy link

v3ss0n commented Jul 14, 2015

Why so hurry, standard is so far from getting standardized .

On Tue, Jul 14, 2015 at 9:55 PM, Ján Sáreník notifications@github.com
wrote:

Any news here?


Reply to this email directly or view it on GitHub
#1438 (comment)
.

@bdarnell
Copy link
Member

The standard is finalized (https://tools.ietf.org/html/rfc7540), but I don't have anything else to report. I haven't had time to work on this recently.

@v3ss0n
Copy link

v3ss0n commented Jul 14, 2015

Oops , i must be living under the rocks. when was that?
That didn't even make much news.

On Wed, Jul 15, 2015 at 12:03 AM, Ben Darnell notifications@github.com
wrote:

The standard is finalized (https://tools.ietf.org/html/rfc7540), but I
don't have anything else to report. I haven't had time to work on this
recently.


Reply to this email directly or view it on GitHub
#1438 (comment)
.

@arturican
Copy link

Wow, standart is finalized so it would be nice uf this feature has been implemented

@rickhanlonii
Copy link

Just noting that Chrome abandoned SPDY for HTTP2 and every iOS 9 application is HTTP/2 by default.

@bdarnell I noticed that #525 (comment) references https://github.com/bdarnell/tornado_http2. Is that a full implementation and can you imagine a way to reconcile the two?

@bdarnell
Copy link
Member

bdarnell commented Oct 7, 2015

As I said before, the major piece missing from tornado_http2 is flow control. #525 implemented SPDY, not HTTP/2, which didn't have the same flow control protocol and so I don't think there's anything to reconcile there. I don't know when I'll be able to finish up flow control so if anyone would like to work on this feel free to claim it.

@hunt3r
Copy link

hunt3r commented Oct 28, 2015

@bdarnell do you have a checklist of what parts of the spec have been completed vs. incomplete? I may be able to assist, but it would be useful to know what state you're in?

@bdarnell
Copy link
Member

No, I don't have a checklist. Off the top of my head, there's flow control and prioritization, and then there's a lot of places in the spec that dictate a certain error-handling behavior that we need to go through and check.

@HelloGrayson
Copy link

Looks like flow control made it into the spec? https://tools.ietf.org/html/rfc7540#section-5.2

@bdarnell
Copy link
Member

bdarnell commented Jan 3, 2016

Flow control is now implemented in https://github.com/bdarnell/tornado_http2, so it's ready for more usage and testing.

@boyxuper
Copy link

boyxuper commented Feb 4, 2016

I think HTTP/2 is more meaningful with connection reuse & stream multiplexing, especially with lots of API query in same origin.
And I've wrote a client, requires h2==2.1.0 & tornado >= 4.0, here's the code
https://github.com/mSOHU/http2

usage:
client = SimpleAsyncHTTP20Client(host=''[, port=], secure=<True | False>, max_streams=30, connect_timeout=1)
then you can use client like old SimpleAsyncHTTPClient

differents:

  • no follow redirections
  • one connection each client, and connect once client object is built
  • HTTP20Response with push_responses, new_request(for redirection)
  • once connection was broken, all sent request are broken as exception HTTP2ConnectionClosed()

features:

  • connect_timeout & request_timeout
  • push streams
  • h2 & h2c supporting
  • do auto-reconnect to server
  • stream multiplexing
  • stream concurrency negotiating

@rafaelcapucho
Copy link

Hello, There are any plans to merge the HTTP/2 support to tornado main branch? Thank you

@bdarnell
Copy link
Member

I plan to merge the HTTP/2 support into Tornado eventually, but not until it's been proven successful. I haven't heard any reports from people using the tornado_http2 package (positive or negative). Are you using it? Is it working for you? What difference does it make for you whether it's in the master branch or a separate package?

@v3ss0n
Copy link

v3ss0n commented May 14, 2016

I haven't try HTTP/2 yet. Busy with our own startup product on pypy + tornado + rethinkdb, actually HTTP2 is really necessary for us. So we will be testing soon.

@yeraydiazdiaz
Copy link

Hi all, I've been working on a different approach on an HTTP/2 server using the hyper-h2 library, here's a quick demo.

It's not feature complete but I've managed to integrate it with the web framework allowing RequestHandler classes to respond seemlessly.

Any feedback or comments would be most welcome, and of course, thanks for the excellent work on Tornado.

@ghost
Copy link

ghost commented Dec 31, 2017

@bdarnell I have recently attempted to use the tornado_http2 package but it appears the _ServerRequestAdapter is not apart of Tornado anymore so I was unable to spin it up.

@bdarnell
Copy link
Member

I've updated tornado_http2 to work with (and probably require) tornado 4.5

@yanmingwang
Copy link

Great, welcome http2

@xmm1989218
Copy link

will tornado_http2 merge into tornado?

@bdarnell
Copy link
Member

will tornado_http2 merge into tornado?

Maybe someday, but I think it only makes sense to merge http/2 into the main package after it's been proven to be usable and reliable as a separate package. Right now I've only heard from one person other than myself who's even tried tornado_http2.

@v3ss0n
Copy link

v3ss0n commented Nov 16, 2018

Many Nodejs frameworks are resupporting HTTP2.
Python community (including myself) is really slow on adopting HTTP2.

@wpjunior
Copy link

@bdarnell Hi, I achieved use of httpclient using http2 with curl, libcurl >= 7.43.0 supports multiplexed requests well, just setting up the number of max_clients =)

@lisongmin
Copy link

I suggest merge http2 into tornado as an experiemntal feature.

so we can running tornado as http/1.1 on product environment, and test http/2 on develop environment with a switch easily.

In this way, we can accelerate http/2 stable, also keep http/2 with latest tornado base. and get more feedback from community too.

@tstordyallison
Copy link

tstordyallison commented Feb 8, 2019

@lisongmin do you suggest we go down the tornado_http2 route or take a look at @yeraydiazdiaz's work on integrating the hyper-h2 library?

hyper-h2 feels like it's approaching something that could be called stable from what I could tell, which makes it a tempting option for something usable in tornado in the near-term.

I'm interested in pushing the hyper-h2 path forward/helping out if others think it's worth it.

@tstordyallison
Copy link

In fact, they even have a tornado example (using TCPServer): https://python-hyper.org/h2/en/stable/tornado-example.html

@h5rdly
Copy link

h5rdly commented May 18, 2019

Quart has http/2 support -
https://pgjones.gitlab.io/quart/http2_tutorial.html

Tornado is well up to date with modern standards, http/2 would be quite on point imo

@pylorak
Copy link

pylorak commented May 23, 2019

Beside choosing between tornado_http2 and hyper-h2 (btw I'd vote for the latter, hyper-h2 is used by multiple projects and is well-tested, so why implement something so non-trivial from scratch in tornado), there is a 3rd option which IMHO is also very interesting, might even be the best:

-> Add ASGI support to tornado.

This would fill two needs with one deed. First, it'd allow users of tornado to freely match their webserver with tornado. Of course the webserver also needs to support ASGI, but there are already multiple ones available (daphne, hypercorn, uvicorn).

Second advantage of supporting ASGI, and the one relevant for this topic, is that HTTP/2-support then becomes a question not for tornado, but for the ASGI server. Two of the three aforementioned servers support HTTP/2 already, so using them with tornado would automatically add HTTP/2 support to tornado.

@h5rdly
Copy link

h5rdly commented May 25, 2019

But then you won't be able to use http/2 using tornado alone, correct?

@pylorak
Copy link

pylorak commented May 26, 2019

But then you won't be able to use http/2 using tornado alone, correct?

Only in a sense. Tornado alone would still be your only application framework component. You'd only use it with an external webserver instead of the built-in one.

@Aeron
Copy link

Aeron commented Jun 4, 2019

How about to move to MagicStack’s httptools?

Cons:

  • It will require to rewrite current HTTP parsing, but for the best in my opinion;
  • Another external dependency.

Pros:

  • Fast async HTTP parsing;
  • HTTP/2 support out-of-the-box.

@v3ss0n
Copy link

v3ss0n commented Jun 8, 2019 via email

@arduinka55055
Copy link

so, do you have some progress on it?
2021 year, and cloudflare for example even has http3 with QUIC

still waiting. tornado is awesome anyway

@bdarnell
Copy link
Member

I have no new updates since #1438 (comment)

The next step here is for folks in the community to try the implementations that already exist and report back - do they work well and meet your needs? That feedback must come before anything can be considered for merging into Tornado proper.

@v3ss0n
Copy link

v3ss0n commented Jun 8, 2022

i agree with @bdarnell . I haven't had any use of HTTP2 yet.
Someone have any idea to start a HTTP2 demo and test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests