From 42c426e7695a0037032d1ac5237830800eeaaed4 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 1 Nov 2023 15:11:01 -0600 Subject: feat(ext/websocket): websockets over http2 (#21040) 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: https://github.com/web-platform-tests/wpt/issues/42896 --- cli/tests/testdata/run/websocket_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/tests/testdata') diff --git a/cli/tests/testdata/run/websocket_test.ts b/cli/tests/testdata/run/websocket_test.ts index 43db15cce..b759d042d 100644 --- a/cli/tests/testdata/run/websocket_test.ts +++ b/cli/tests/testdata/run/websocket_test.ts @@ -163,7 +163,7 @@ Deno.test("websocket error", async () => { // Error message got changed because we don't use warp in test_util assertEquals( err.message, - "InvalidData: invalid data", + "NetworkError: failed to connect to WebSocket: invalid data", ); promise1.resolve(); }; -- cgit v1.2.3