hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 265 forks source link

Make the hpack a public module #735

Closed ymesika closed 5 months ago

ymesika commented 5 months ago

This PR is making the hpack module with its encoder/decoder as public for other projects which have the need for this low-level capablities specifically.

seanmonstar commented 5 months ago

Thanks for the PR! While I'm not against exposing hpack, theoretically, I think it's something that should be done with care. Once the types are made public, we can't change them internally if we want to optimize.

What's the use case for needing hpack? Is it to implement a different HTTP/2 library, while reusing our hpack module?

ymesika commented 5 months ago

@seanmonstar thanks for reviewing. I understand your concern exposing the interfaces and I found a crate which covers our needs at the moment. Unfortunately all other hpack crates seem to be unmaintained (and maybe it's because there is nothing to maintain there) but have you thought making the internal hpack impl in this crate as a separate one?

Our needs are more lower level adding headers sniffing in a TCP proxy.

ilrudie commented 5 months ago

@seanmonstar, what would be your thoughts about working on a net new public API instead of exposing the internal?