Test all modules in npm test; fix axios/got/superagent on 4xx#1
Merged
Test all modules in npm test; fix axios/got/superagent on 4xx#1
Conversation
- npm test: explicitly run core, axios, node-fetch, got, undici, superagent - Axios: use validateStatus: () => true so proxy header check works when target returns 4xx - Got: create client with throwHttpErrors: false for same reason - Superagent: chain .ok(() => true) so response is returned on 4xx Made-with: Cursor
- When SEND_PROXY_HEADER and SEND_PROXY_VALUE are set and we check the same header, test now requires the proxy response value to equal SEND_PROXY_VALUE. - ProxyHeadersAgent: stop returning proxySocket from createConnection so the agent uses only the callback stream (tlsSocket). Returning the raw socket let the agent write the request before CONNECT completed, so the proxy sometimes ignored our X-ProxyMesh-IP and assigned a different IP. - utils.buildConnectRequest: support proxyHeaders as Map for consistency. Made-with: Cursor
proxymesh
approved these changes
Mar 8, 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.
Changes
npm test now explicitly runs all six modules:
core,axios,node-fetch,got,undici,superagentsonpm testalways tests every module regardless of how the script is invoked.Axios, Got, Superagent tests no longer fail when the test URL returns 4xx (e.g.
https://proxymesh.com/api/headers/returning 400 for some User-Agents). The harness only needs to verify that proxy headers are sent and received; it does not require a 2xx from the target.validateStatus: () => trueon the requestgotOptions: { throwHttpErrors: false }when creating the client.ok(() => true)on the requestMade with Cursor