Closed
Description
Checks
- I understand project setup issues should be asked on StackOverflow or in GitHub Discussions.
- I updated to latest
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
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
Labels
No labels