8000 Unable to proxy over https with domain that points to localhost · Issue #865 · chimurai/http-proxy-middleware · GitHub
[go: up one dir, main page]

Skip to content
Unable to proxy over https with domain that points to localhost #865
Closed
@TrevorBurnham

Description

@TrevorBurnham

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0