Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Unable to proxy over https with domain that points to localhost #865

Closed
2 tasks done
TrevorBurnham opened this issue Jan 10, 2023 · 0 comments
Closed
2 tasks done

Comments

@TrevorBurnham
Copy link

Checks

Describe the bug (be clear and concise)

When running a local service over HTTPS, attempting to use a domain that resolves to 127.0.0.1 does not work.

Step-by-step reproduction instructions

1. Run a local service over HTTPS on port 8443.
2. Try modifying `examples/express/index.js` to use this config:
    
    
    createProxyMiddleware({
      target: 'https://xyz.localhost.me:8443',
      changeOrigin: true,
      secure: false,
    });
    

3. Run the example. This will yield `Error occurred while proxying request localhost:3000/ to http://xyz.localhost.me:3000/users [ENOTFOUND]`.

Expected behavior (be clear and concise)

Specifying the target with 127.0.0.1 instead of the domain causes the request to be proxied successfully:

createProxyMiddleware({
  target: 'https://127.0.0.1:8443',
  changeOrigin: true,
  secure: false,
});

I would expect the behavior with the domain to be the same.

How is http-proxy-middleware used in your project?

I ran into this behavior when trying to use webpack-dev-server, but was able to replicate with the `http-proxy-middleware@3.0.0-beta.0` build in isolation.

What http-proxy-middleware configuration are you using?

N/A

What OS/version and node/version are you seeing the problem?

macOS 12.6.2 and Node v18.12.1

Additional context (optional)

I'd thought this might be related to #705, but I got the same behavior with both Node 14 and Node 18.

Repository owner locked and limited conversation to collaborators Feb 12, 2023
@chimurai chimurai converted this issue into discussion #876 Feb 12, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant