feat: update minimal supported version of Node.js to v20#638
Open
bliuchak wants to merge 5 commits intoversion-3.0from
Open
feat: update minimal supported version of Node.js to v20#638bliuchak wants to merge 5 commits intoversion-3.0from
bliuchak wants to merge 5 commits intoversion-3.0from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the minimal supported Node.js version from v14 to v20 to align with active LTS versions (20, 22, 24) and address the Node.js 18 end-of-life. The upgrade addresses Node.js 20's stricter HTTP parsing and default keep-alive behavior changes.
Changes:
- Updated minimum Node.js version requirement from >=14 to >=20
- Disabled HTTP keep-alive across test servers to prevent connection tracking issues
- Added logic to skip 51 tests on Node.js 20+ that rely on lenient HTTP parsing
- Updated error message handling for connection failures to account for Node.js 20 behavior changes
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated engines.node requirement from >=14 to >=20 |
| .github/workflows/check.yaml | Updated test matrix to Node.js 16, 18, 20 and changed lint condition to run on Node 20 |
| test/Dockerfile | Updated base Docker image from Node 18.20.8 to Node 20.19.6 |
| test/utils/target_server.js | Disabled keep-alive on HTTP test server by setting keepAliveTimeout to 0 |
| test/server.js | Added Connection: 'close' header to test requests and disabled keep-alive on proxy servers; added Node.js version check to skip tests for stricter HTTP parsing |
| test/https-stress-test.js | Disabled keep-alive on global HTTP agent and proxy server |
| test/anonymize_proxy.js | Updated error assertion to accept both 'ECONNREFUSED' and 'socket hang up' messages |
| test/anonymize_proxy_no_password.js | Updated error assertion to accept both 'ECONNREFUSED' and 'socket hang up' messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jirimoravcik
approved these changes
Jan 13, 2026
danpoletaev
requested changes
Jan 13, 2026
danpoletaev
left a comment
There was a problem hiding this comment.
Looks good!
Left few suggestions that needs to be reviewed before merging
lewis-wow
approved these changes
Jan 20, 2026
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.
This PR upgrades minimal supported version of Node.js to v20.
Why Node.js 20?
I think for us it makes sense to support last 3 LTS versions of node. As of today they are: 24, 22 and 20.
Also I'll keep tests at Github Actions for Node.js 16, 18 and 20 (will be added) to make sure we're not breaking too much things. At least right now. However this might change in next major release.
Migration Flow
Migration from Node.js 18 to 20 wasn't complicated. Here are the main issues which we've faced:
keep-aliveby default. This should be turned off in tests explicitly.socket hang upinstead ofECONNREFUSEDfor some special casesSkipped Tests On Node.js 20
Overview
There was 2242 tests cases for Node.js v18. Currently there are 2191 (minus 51 test case) for Node.js v20. See details below:
!useUpstreamProxy:!useUpstreamProxy && !useSsl:Grand total: 34 + 17 = 51 skipped tests
Why these tests are skipped
Both tests verify the proxy's behavior when receiving malformed HTTP responses from upstream servers:
In Node.js 20, the
--insecure-http-parserflag no longer relaxes HTTP client parsing for these edge cases. The HTTP client throws parse errors before the proxy can even process them. This is a Node.js security hardening change, not a proxy bug.Close #601