Skip to content

Joining efforts with the CherryPy team #84

Closed

Description

@webknjaz

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 :)

Activity

  1. njsmith commented on May 24, 2019

    @njsmith
    Member

    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!

  2. ian-otto commented on Jan 22, 2020

    @ian-otto
    Contributor

    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?

  3. njsmith commented on Jan 22, 2020

    @njsmith
    Member

    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.

  4. njsmith commented on Jan 22, 2020

    @njsmith
    Member

    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.

  5. webknjaz commented on Jul 31, 2020

    @webknjaz
    ContributorAuthor

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

    Any chance you could give a green light there?

  6. webknjaz commented on Jul 31, 2020

    @webknjaz
    ContributorAuthor

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

  7. webknjaz commented on Aug 12, 2020

    @webknjaz
    ContributorAuthor

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

  8. pgjones commented on Aug 13, 2020

    @pgjones
    Member

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

  9. webknjaz commented on Aug 13, 2020

    @webknjaz
    ContributorAuthor

    @pgjones thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions