Repository navigation
feat(network): honor HTTPS_PROXY, HTTP_PROXY and NO_PROXY - #51
Merged
Merged
Conversation
Node's fetch ignores the proxy variables unless Node was started with NODE_USE_ENV_PROXY=1 (22.21+, 24+). Cursor's sandbox allows the network only through the proxy it names in them, so every command there failed at its first request, and the Meshy plugin had to start the CLI with NODE_USE_ENV_PROXY=1. At start, when HTTPS_PROXY or HTTP_PROXY is set (lowercase spellings too), install undici's EnvHttpProxyAgent as the global dispatcher, so every fetch goes through the proxy unless NO_PROXY exempts its host, on every Node the CLI supports. Without the variables nothing changes (D-093). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n a bad proxy URL - http: URLs go to the proxy as plain forwarded requests (proxyTunnel: false), as curl sends them; https: still tunnels. A proxy that refuses CONNECT but forwards HTTP works. - localhost, 127.0.0.1 and [::1] always go direct, as Go's net/http does, so a local API's credential never crosses the proxy. - A proxy value that is not an http(s) URL no longer throws at start with the value (and any password) in the stack: every request fails before it leaves, naming the variable only. Local commands still run. - A proxy that refuses the request (CONNECT not 200, forwarded 407) is a request never sent: the transport classifies it as connect, so a task is recorded not_submitted rather than unknown, and the error says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a proxy is set - This machine (localhost, 127.0.0.0/8, ::1) goes direct through a thin dispatcher in front of EnvHttpProxyAgent, instead of entries appended to NO_PROXY, which broke NO_PROXY=* and could not express the range. - A proxy URL is checked by building the ProxyAgent undici would build, so values that parse as URLs but that undici rejects (a bad escape, a query) fail closed with the variable named instead of throwing at start. - Sign-in, downloads and input URL checks report a proxy failure the same way, and sign-in points at the proxy variables. - undici loads only when a proxy variable is set (proxy-dispatcher.ts, a dynamic import): it cost every command about 40 ms at start. - Docs: an https:// proxy tunnels http: URLs too (undici has no switch). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est never sent undici wraps a certificate-name mismatch with an https:// proxy as SecureProxyConnectionError (UND_ERR_PRX_TLS), which the transport did not count as a connect failure, so a create that never left was recorded with an unknown outcome. proxyFailure() now recognizes it, and the message says the TLS connection to the proxy failed. Other certificate and connection errors with the proxy already arrive as their own errno. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AltaMills
added a commit
that referenced
this pull request
Nov 9, 2026
Version 0.8.5 for the release: requests honor `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY` on every supported Node (D-093, #51). Cursor's sandbox allows the network only through such a proxy; with this release the Meshy plugin no longer needs `NODE_USE_ENV_PROXY=1`. Checked locally on this branch: - `pnpm typecheck` - `pnpm test`: 705 tests, 704 pass, 0 fail, 1 skipped (already skipped before) - `pnpm build` - `node dist/index.js --version` prints 0.8.5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
AltaMills
added a commit
to meshy-dev/meshy-3d-agent
that referenced
this pull request
Nov 9, 2026
0.8.5 (meshy-dev/meshy-cli#51) honors HTTPS_PROXY / HTTP_PROXY / NO_PROXY on every supported Node, so the CLI works inside Cursor's sandbox without NODE_USE_ENV_PROXY=1. It includes 0.8.4's agent segment in the User-Agent. Raise the minimum and the temporary package from 0.8.4 to 0.8.5; the release stays 0.9.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serafin-meshy
pushed a commit
to meshy-dev/meshy-3d-agent
that referenced
this pull request
Nov 9, 2026
…t (0.9.5) (#28) * [PRO-4051] require Meshy CLI 0.8.4, which names the AI agent (0.9.5) Meshy CLI 0.8.4 names the AI agent running a command (Cursor, Claude Code, Codex, ...) in the User-Agent of its requests to Meshy, and meshyd now records it (taichi-dev/meshyd#8127). The skills only upgrade a CLI older than their minimum, so a machine with 0.8.3 would never send it: raise the minimum and the temporary package to 0.8.4, and release 0.9.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * [PRO-4051] require Meshy CLI 0.8.5: agent attribution and proxy support 0.8.5 (meshy-dev/meshy-cli#51) honors HTTPS_PROXY / HTTP_PROXY / NO_PROXY on every supported Node, so the CLI works inside Cursor's sandbox without NODE_USE_ENV_PROXY=1. It includes 0.8.4's agent segment in the User-Agent. Raise the minimum and the temporary package from 0.8.4 to 0.8.5; the release stays 0.9.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Node's
fetchignoresHTTPS_PROXY/HTTP_PROXY/NO_PROXYunless Node itself was started withNODE_USE_ENV_PROXY=1(Node 22.21+, 24+). Cursor's sandbox allows the network only through a proxy it names in those variables, so every meshy-cli command there failed at its first request (oauth_network). The Meshy plugin works around it by starting the CLI withNODE_USE_ENV_PROXY=1(meshy-dev/meshy-3d-agent#27), which needs a newer Node than the CLI requires (22.12+).With this change the CLI honors the variables itself:
src/index.ts), before any request,useProxyFromEnv()(src/internal/proxy.ts) readshttps_proxy/HTTPS_PROXY,http_proxy/HTTP_PROXYandno_proxy/NO_PROXY, lowercase first as curl and undici do.EnvHttpProxyAgentas the global dispatcher once. Everyfetchthen goes through the proxy: the API, sign-in, downloads, input URL checks, and the update check's child, which starts through the same entry point.https:URLs useHTTPS_PROXY(a CONNECT tunnel) and fall back toHTTP_PROXY.http:URLs go to the proxy as plain forwarded requests (proxyTunnel: false), as curl sends them.NO_PROXYgo direct (passed as given, so*still means all), and so does this machine (localhost,127.0.0.0/8,::1) always, as Go'snet/httpdoes, so a local API's credential never crosses the proxy in the clear.NO_PROXYcannot express a range, so a thin dispatcher in front sends loopback hosts to a plain agent and everything else toEnvHttpProxyAgent.https://proxy tunnelshttp:URLs too: undici forwards plain HTTP only through anhttp://proxy and has no switch for it. Documented indocs/usage.mdand D-093.http://orhttps://, no host, a query, a bad escape. The check builds theProxyAgentundici would build, so nothing undici accepts is refused. Every request fails before it leaves, with an error that names the variable and never its value (it may hold a password). Local commands still run. Sign-in, downloads and input URL checks report the same message, and sign-in points at the proxy variables.https://proxy fails (UND_ERR_PRX_TLS), never reached Meshy.proxyFailure()recognizes undici's errors for these, and the transport classifies them asconnect, so a task create is recordednot_submittedrather thanunknown. The error says it was the proxy.src/internal/proxy-dispatcher.ts, dynamically imported). Loading it at every start cost about 40 ms:--versiontakes 106 ms without a proxy variable, against 157 ms when it was imported up front. Node's ownhttp.setGlobalProxyFromEnvexists in 24.20 but not in Node 22. The global dispatcher is what Node's built-infetchuses on both, so one code path covers every supported Node. Verified on Node 22.23 (bundled undici 6.29) and 24.20 (bundled undici 7.29).https:URLs the proxy sees only a CONNECT tunnel.--helpenvironment list,docs/usage.md, and decision D-093 indocs/decisions.md.Once a release with this is out, the plugin can drop
NODE_USE_ENV_PROXY=1and the Node version it needs.Tests
tests/proxy.test.ts, with a loopback forward proxy that counts what it carries. Targets that must go through it use a.invalidhost, which never resolves, so a request that reaches the target went through the proxy:"", so undici does not readprocess.envagain;NO_PROXYpassed as given;http:request;NO_PROXY(including*),localhost,127.0.0.1and[::1]go direct, andisLoopbackHostcovers 127.0.0.0/8 and IPv4-mapped forms;neverSent, with an error naming the proxy;https://proxy (undici'sUND_ERR_PRX_TLS, built as fetch delivers it) isneverSenttoo;balancerequest goes throughHTTP_PROXY, and an API on loopback is reached directly.Runs:
pnpm teston Node 24.20: 705 tests, 704 pass, 1 skipped, 0 fail (see the latest commit).tests/proxy.test.tson Node 22.23 and 24.20: 9/9 pass.useProxyFromEnv()call; tunnelinghttp:again; looking only one cause deep for the refusal; letting an invalid URL go direct; skipping theProxyAgentcheck; loopback as127.0.0.1only; dropping the loopback dispatcher; appending toNO_PROXYagain; the old sign-in hint; not recognizingUND_ERR_PRX_TLS.Not covered in the suite: an
https:request completed through a CONNECT tunnel to a TLS target (no TLS target in the suite). The review checked it separately on Node 22.12.0, including a certificate-name mismatch still failing.🤖 Generated with Claude Code