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:
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?
Checks
http-proxy-middleware
.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
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:I would expect the behavior with the domain to be the same.
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
I'd thought this might be related to https://github.com/chimurai/http-proxy-middleware/issues/705, but I got the same behavior with both Node 14 and Node 18.