Repository navigation
Test WebSockets through an HTTP/2 reverse proxy - #671
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We had no integration coverage for an RFC 8441 client connecting through an HTTP/2 reverse proxy to an IXWebSocket HTTP/1.1 server. Add a standalone test for:
The client validates the test certificate, requires ALPN
h2, waits for ENABLE_CONNECT_PROTOCOL, and requires a 200 response to Extended CONNECT. It omits Sec-WebSocket-Key, so the proxy must perform a real HTTP/2-to-HTTP/1.1 handshake translation. No HTTP/1.1 frontend fallback is possible.Coverage includes text/binary/empty/Unicode messages, fragmentation, ping/pong, negotiated per-message deflate on/off, 256 KiB incompressible messages with an assertion that send flow control blocks/resumes, forwarded paths/query/Origin/custom headers, three concurrent streams, isolated close/reset, close code/reason preservation in both directions, and a fresh WebSocket stream on the existing H2 connection. The backend stops normally and joins its workers.
make -f makefile.dev test_h2_proxybuilds current source and runs the services in an isolated Docker network namespace without published ports. It prints progress and saves JSON results and backend/proxy logs under build/h2-proxy. Pinned Python dependencies live only in the test image/optional native venv. The C++11 fixture uses existing public APIs; production code and dependencies are unchanged.The separate h2-proxy workflow runs on master/manual dispatch and on PRs labeled h2-proxy, with reports uploaded on failure. The regular unit suite is unchanged. Native nghttpx and Envoy reproduction modes are documented.
An actual proxy limitation was found: Envoy 1.31.0 omits the upstream Sec-WebSocket-Key when downgrading Extended CONNECT, and IXWebSocket correctly rejects that HTTP/1.1 request with 400. Retain an opt-in strict reproduction, with no legacy key injection or relaxed backend validation. See envoyproxy/envoy#8547 and pending envoyproxy/envoy#46959. The default passing test uses nghttpx 1.52.0.
Validation: 11 groups pass repeatedly with compression on/off and clean backend exit (roughly one second for the test phase locally, separate from the Docker image build). The Envoy reproduction reliably fails for the expected missing-key reason. Native C++11 fixture build, Python syntax checks, clang-format, and diff checks pass. This is protocol interoperability coverage, not browser automation or native HTTP/2 library support.