Draft
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.
The repo only had legacy Perl
Test::Nginx::Sockettests and no CI. This adds a self-contained, modern e2e suite that builds nginx with the module and drives the public WebSocket endpoint with a standards-compliant client, runnable locally and in GitHub Actions.Changes
e2e/harness.mjs) — spins up a TCP echo upstream (stand-in for a websockify/VNC backend) and an nginx instance built with the module on ephemeral ports, with config validation and automatic teardown.e2e/test/websockify.test.mjs) — Node's built-innode:testrunner +ws, covering:binaryround-trip,base64decode/re-encode, subprotocol preference (binaryoverbase64), large (1 MiB) streaming, rejection of unsupported subprotocols, and dead-upstream teardown.e2e/build-nginx.sh) — compiles a configurable nginx version (NGINX_VERSION, nginx.org with GitHub mirror fallback) with the module added; prints the binary path..github/workflows/e2e.yml) — runs the suite on push/PR across nginx 1.24.0 / 1.25.3 / 1.27.3, withpermissions: contents: read.e2e/README.mdplus a Testing section inREADME.md.Note on observed behavior
With an unreachable upstream the module completes the WebSocket handshake (
101) and then closes abnormally (1006) rather than returning502. The dead-upstream test asserts against this actual behavior; worth confirming it is intended.