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

Joining efforts with the CherryPy team #84

Closed
webknjaz opened this issue May 24, 2019 · 9 comments
Closed

Joining efforts with the CherryPy team #84

webknjaz opened this issue May 24, 2019 · 9 comments

Comments

@webknjaz
Copy link
Contributor

Hi,

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.

Ref: cherrypy/cheroot#201.

I haven't checked h11 deeply so I'm publishing this just to document the intention :)

@njsmith
Copy link
Member

njsmith commented 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
Copy link
Contributor

ian-otto commented 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
Copy link
Member

njsmith commented 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
Copy link
Member

njsmith commented 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
Copy link
Contributor Author

Hey, @njsmith! It seems like #99 is blocking our progress :(

Any chance you could give a green light there?

@webknjaz
Copy link
Contributor Author

@njsmith thanks for merging that! Could you please also cut a release so that we could depend on it as published on PyPI?

@webknjaz
Copy link
Contributor Author

Hey @njsmith, could you please unblock us by releasing the recent changes to PyPI?

@pgjones
Copy link
Member

pgjones commented Aug 13, 2020

@webknjaz I've released 0.10.0, which should unblock you. Lets find out how h11 works with CherryPy!

@webknjaz
Copy link
Contributor Author

@pgjones thanks a lot!

@pgjones pgjones closed this as completed Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants