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

feat(ext/websocket): websockets over http2 #21040

Merged
merged 13 commits into from
Nov 1, 2023
Merged

Conversation

mmastrac
Copy link
Contributor

@mmastrac mmastrac commented Nov 1, 2023

Implements WebSocket over http/2. This requires a conformant http/2 server supporting the extended connect protocol.

Passes approximately 100 new WPT tests (mostly ?wpt_flags=h2 versions of existing websockets APIs).

This is implemented as a fallback when http/1.1 fails, so a server that supports both h1 and h2 WebSockets will still end up on the http/1.1 upgrade path.

The patch also cleas up the websockets handshake to split it up into http, https+http1 and https+http2, making it a little less intertwined.

This uncovered a likely bug in the WPT test server: web-platform-tests/wpt#42896

@mmastrac mmastrac changed the title WIP: feat(ext/websocket): websockets over http2 feat(ext/websocket): websockets over http2 Nov 1, 2023
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Can you add ci-bench label and then push an empty commit to make sure everything works correctly?

Copy link
Member

Choose a reason for hiding this comment

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

Nice!!

Comment on lines +172 to +174
// TODO(mmastrac): this is possibly just too difficult, but we'll never call it
unimplemented!()
}
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure this won't be hit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep -- I explicitly disabled the writev flag on fastwebsockets for H2.

@mmastrac mmastrac added the ci-bench put this on a PR to run the benchmarks label Nov 1, 2023
@mmastrac mmastrac enabled auto-merge (squash) November 1, 2023 20:43
@mmastrac mmastrac merged commit 42c426e into denoland:main Nov 1, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-bench put this on a PR to run the benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants