go-proxyproto icon indicating copy to clipboard operation
go-proxyproto copied to clipboard

Example HTTP server code doesn't support HTTP/2 upgrade

Open emersion opened this issue 2 years ago • 3 comments

net/http can't access PP2_TYPE_ALPN which is necessary for the HTTP/2 upgrade.

Some manual logic is necessary to handle HTTP/2 upgrades, e.g. https://git.sr.ht/~emersion/kimchi/tree/master/item/server.go#L175

Would it be desirable to host this glue code in go-proxyproto so that users can easily fire up an HTTP server with HTTP/2 upgrade support?

emersion avatar Apr 07 '22 20:04 emersion

Would it be enough to introduce a new example app in the examples folder?

pires avatar Jun 27 '22 19:06 pires

The boilerplate is annoying to type, so I'd prefer to have it in the lib somehow.

emersion avatar Jun 27 '22 19:06 emersion

Maybe we create a new package helper/http2? As we move forward, we can even deprecate some specific code for cloud-providers and move to the helper package, ie helper/aws, WDYT?

pires avatar Jun 30 '22 09:06 pires