You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm one of the maintainers of CherryPy. Currently, we have a subproject which implements HTTP/WSGI server as a separate Python package distribution. It's called Cheroot.
It implements own HTTP parsing layer.
Given that having a one good framework-agnostic protocol implementation is one honking great idea, it seems logical to use that instead of supporting own parser.
I'm looking forward to seeing how we could integrate h11 and also porting things from Cheroot/CherryPy into h11 in order to have one superior HTTP parser.
I don't currently know of any changes needed on h11's side; it's already designed to be dropped into a server like CherryPy. There may be some real-world compatibility issues that you flush out, because HTTP/1.1 has many poorly-specified edge cases, but the only unresolved one I know about currently is #31 (h11 doesn't preserve header case) and that's mostly an issue for clients, not servers.
Let us know how it goes!
Reacted by 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
Hey there, I'm one of the developers working on this task and I'm confused about the terminology of this page. According to the page, "h11 only speaks HTTP/1.1", but in that same page, "It can talk to HTTP/1.0 clients and servers".
I'm at a point where our HTTP/1.1 parser is working correctly in tests, but it's failing when the tests initially start with HTTP/1.0 with an error stating that h11 only speaks HTTP/1.1. Is there a workaround to allow h11 to talk to an HTTP/1.0 client that I'm missing?
HTTP/1.1 is supposed to be backwards compatible with HTTP/1.0, so any correct implementation of HTTP/1.1 should work fine when the other side is speaking HTTP/1.0. Of course, HTTP in the real world doesn't always work the way the standards say it should, so it's possible that we have some bugs here. But I'm not aware of any bugs like that currently. A server using h11 should Just Work when a client speaks HTTP/1.0.
Are you trying to explicitly detect what version the client is using and speak the same version back to it? You don't need to do that.
Activity
njsmith commentedon May 24, 2019
Unsurprisingly, I think this would be great :-).
I don't currently know of any changes needed on h11's side; it's already designed to be dropped into a server like CherryPy. There may be some real-world compatibility issues that you flush out, because HTTP/1.1 has many poorly-specified edge cases, but the only unresolved one I know about currently is #31 (h11 doesn't preserve header case) and that's mostly an issue for clients, not servers.
Let us know how it goes!
ian-otto commentedon Jan 22, 2020
Hey there, I'm one of the developers working on this task and I'm confused about the terminology of this page. According to the page, "h11 only speaks HTTP/1.1", but in that same page, "It can talk to HTTP/1.0 clients and servers".
I'm at a point where our HTTP/1.1 parser is working correctly in tests, but it's failing when the tests initially start with HTTP/1.0 with an error stating that h11 only speaks HTTP/1.1. Is there a workaround to allow h11 to talk to an HTTP/1.0 client that I'm missing?
njsmith commentedon Jan 22, 2020
HTTP/1.1 is supposed to be backwards compatible with HTTP/1.0, so any correct implementation of HTTP/1.1 should work fine when the other side is speaking HTTP/1.0. Of course, HTTP in the real world doesn't always work the way the standards say it should, so it's possible that we have some bugs here. But I'm not aware of any bugs like that currently. A server using h11 should Just Work when a client speaks HTTP/1.0.
Are you trying to explicitly detect what version the client is using and speak the same version back to it? You don't need to do that.
njsmith commentedon Jan 22, 2020
Looks like the relevant PR is cherrypy/cheroot#262, and the solution is indeed to just speak HTTP/1.1 even if the peer only speaks HTTP/1.0.
webknjaz commentedon Jul 31, 2020
Hey, @njsmith! It seems like #99 is blocking our progress :(
Any chance you could give a green light there?
webknjaz commentedon Jul 31, 2020
@njsmith thanks for merging that! Could you please also cut a release so that we could depend on it as published on PyPI?
webknjaz commentedon Aug 12, 2020
Hey @njsmith, could you please unblock us by releasing the recent changes to PyPI?
pgjones commentedon Aug 13, 2020
@webknjaz I've released 0.10.0, which should unblock you. Lets find out how h11 works with CherryPy!
webknjaz commentedon Aug 13, 2020
@pgjones thanks a lot!