Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS Proxy issue from version 22 #4512

Open
2 tasks done
m4tt30c91 opened this issue Dec 9, 2024 · 1 comment
Open
2 tasks done

NodeJS Proxy issue from version 22 #4512

m4tt30c91 opened this issue Dec 9, 2024 · 1 comment
Labels

Comments

@m4tt30c91
Copy link

m4tt30c91 commented Dec 9, 2024

Node.js Version

v22.12.0

NPM Version

10.9.0

Operating System

Microsoft Windows 10 Pro

Subsystem

Other

Description

After upgrading to node version 22, it seems the proxy configuration is not working anymore.
We are behind a corporate proxy, so we use local proxy servers to install node packages; we tried with fiddler, px and others, but the result is the same.

This is our configuration:

proxy=http://localhost:3128
https-proxy=http://localhost:3128
strict-ssl=false
registry=[INTERNAL_REGISTRY]

We tried with the previous LTS (node 20) and everything worked as expected; the same goes for node 21.
When we upgraded to node 22, when we tried to install packages we got an ECONNREFUSED issue. We tried also with node 23, but we got the same issue.

We also checked the documentation and internal changelogs, but it seems to be no reference to changes that may have affected the proxy configuration.

Are we missing some configuration or similar?

Thanks.

Minimal Reproduction

You should get an ECONNREFUSED issue

Output

npm http fetch GET [INTERNAL_REGISTRY] attempt 1 failed with ECONNREFUSED

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
@prmces
Copy link

prmces commented Dec 18, 2024

Im having similar issue after upgrading from 22.11.0 to 22.12.0

I have a scenario with angular + net 9 backend + httponlycookies authentication. I have implemented this proxy to be able to test locally while debugging (localhost:4200 for angular and localhost:60112 for backend)

I just downgraded to 22.11.0 and it works fine and proxied to localhost:60112 (my backend only accepts localhost, and not 127.0.0.1)

In 22.12.0, it is always translated to 127.0.0.1 regardless of the localhost configuration.

Image

{
  "/backend": {
    "target": "http://localhost:60112",
    "secure": false,
    "changeOrigin": true,
    "logLevel": "debug",
    "cookieDomainRewrite": "localhost",
    "pathRewrite": {
      "^/backend": ""
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants