Skip to content

Add an helper for proxied HTTP/2 #102

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

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Add an helper for proxied HTTP/2 #102

merged 1 commit into from
Sep 11, 2023

Conversation

emersion
Copy link
Contributor

The standard library's http.Server supports HTTP/2, but only for tls.Conn. This doesn't work when serving connections behind a reverse proxy which terminates TLS and uses the PROXY protocol.

Supporting this requires some glue code, which the new helper provides.

The example was tested with tlstunnel.

Closes: #90

@coveralls
Copy link

coveralls commented Jul 26, 2023

Coverage Status

coverage: 95.017%. remained the same when pulling 5343f12 on emersion:h2 into 864358a on pires:main.

@emersion emersion force-pushed the h2 branch 5 times, most recently from a418627 to e3a3503 Compare July 26, 2023 16:14
@pires pires self-assigned this Sep 7, 2023
Copy link
Owner

@pires pires left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but would you be so kind to document the code a little more? It would definitely help reviewing, and enrich our API docs.

The standard library's http.Server supports HTTP/2, but only for
tls.Conn. This doesn't work when serving connections behind a
reverse proxy which terminates TLS and uses the PROXY protocol.

Supporting this requires some glue code, which the new helper
provides.

The example was tested with tlstunnel.

Closes: pires#90
@emersion
Copy link
Contributor Author

Hopefully this addresses your comments. Let me know if something is still unclear.

@pires
Copy link
Owner

pires commented Sep 11, 2023

Thanks a ton, @emersion 🙇🏻

@pires pires merged commit d628850 into pires:main Sep 11, 2023
@emersion emersion deleted the h2 branch October 2, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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