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

proxy: add http2 support #6335

Closed
wants to merge 10 commits into from
Closed

proxy: add http2 support #6335

wants to merge 10 commits into from

Conversation

conradludgate
Copy link
Contributor

Problem

Proxy already supported HTTP2, but I expect no one is using it because we don't advertise it in the TLS handshake.

WebSockets over HTTP2 is a different story and we need more explicit handling of it. Thankfully the protocol is exactly the same, just the handshake is different.

Summary of changes

  1. Add protocol list for h2 and http/1.1
  2. vendor hyper-tungstenite implementation
  3. introduce extended connect handshake for websockets over http2

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

Copy link

github-actions bot commented Jan 11, 2024

2256 tests run: 2171 passed, 0 failed, 85 skipped (full report)


Flaky tests (3)

Postgres 15

  • test_crafted_wal_end[last_wal_record_crossing_segment]: debug
  • test_crafted_wal_end[simple]: debug

Postgres 14

  • test_delete_tenant_exercise_crash_safety_failpoints[mock_s3-tenant-delete-before-create-remote-mark-True-Check.RETRY_WITH_RESTART]: debug

Code coverage (full report)

  • functions: 55.1% (10306 of 18720 functions)
  • lines: 81.5% (58717 of 72037 lines)

The comment gets automatically updated with the latest test results
2430612 at 2024-01-12T18:50:56.164Z :recycle:

@vadim2404
Copy link
Contributor

can we have tests that websocket works on http1.1 and http2?

@conradludgate
Copy link
Contributor Author

conradludgate commented Jan 12, 2024

Adding a WS over HTTP2 test will be tricky. Waiting on encode/httpx#304 + encode/httpcore#592.

I'll write an initial rust-based test, but that won't validate it's correct - only that it works writing the rust based test will be tricky

@conradludgate conradludgate mentioned this pull request Feb 19, 2024
5 tasks
conradludgate added a commit that referenced this pull request Feb 20, 2024
## Problem

Proxy already supported HTTP2, but I expect no one is using it because
we don't advertise it in the TLS handshake.

## Summary of changes

#6335 without the websocket changes.
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

Successfully merging this pull request may close these issues.

2 participants