-
Notifications
You must be signed in to change notification settings - Fork 868
Open
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)
i have this message error (node:11716) [DEP0060] DeprecationWarning: The util._extend
API is deprecated. Please use Object.assign() instead.
at ProxyServer. (C:\pierre\html\sitev2\frontend\node_modules\http-proxy\lib\http-proxy\index.js:50:26)
at HttpProxyMiddleware.middleware (C:\pierre\html\sitev2\frontend\node_modules\http-proxy-middleware\dist\http-proxy-middleware.js:23:32)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) i tried to uptade both of dependancies and nothing change
Step-by-step reproduction instructions
1. install the package
2. redirect your traffic api to an another web server with this app2.use('/api', createProxyMiddleware({
target: 'http://localhost:8081',
changeOrigin: true,
secure: false, // si backend en HTTPS avec certificat self-signé (à ajuster selon ton cas)
logLevel: 'warn', // ou 'debug' pour débugger
onError: (err, req, res) => {
new log('Proxy error: ' + err);
if (!res.headersSent) {
res.status(502).json({ error: 'Erreur de proxy vers le backend' });
}
},
ws: true,
})
);
3. do a request on the api (you need to create a app.post) for mine i use app.post('/api/auth'....)
Expected behavior (be clear and concise)
change the http-proxy version or fix it
How is http-proxy-middleware used in your project?
site@1.0.0 C:\pierre\html\sitev2\frontend
└── http-proxy-middleware@3.0.5
What http-proxy-middleware configuration are you using?
app2.use('/api', createProxyMiddleware({
target: 'http://localhost:8081',
changeOrigin: true,
secure: false, // si backend en HTTPS avec certificat self-signé (à ajuster selon ton cas)
logLevel: 'warn', // ou 'debug' pour débugger
onError: (err, req, res) => {
new log('Proxy error: ' + err);
if (!res.headersSent) {
res.status(502).json({ error: 'Erreur de proxy vers le backend' });
}
},
ws: true,
})
);
What OS/version and node/version are you seeing the problem?
PS C:\pierre\html\sitev2\frontend> npx envinfo
Need to install the following packages:
envinfo@7.14.0
Ok to proceed? (y) y
System:
OS: Windows 11 10.0.26100
CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
Memory: 7.12 GB / 15.79 GB
Binaries:
Node: 22.12.0 - C:\Program Files\nodejs\node.EXE
npm: 11.4.0 - C:\pierre\node_modules\.bin\npm.CMD
Managers:
pip3: 24.2 - C:\Python312\Scripts\pip3.EXE
Utilities:
Git: 2.47.1.
Curl: 8.13.0 - C:\WINDOWS\system32\curl.EXE
Virtualization:
Docker: 28.1.1 - C:\Program Files\Docker\Docker\resources\bin\docker.EXE
Docker Compose: 2.35.1 - C:\Program Files\Docker\Docker\resources\bin\docker-compose.EXE
SDKs:
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
IDEs:
VSCode: 1.102.3 - C:\Users\matthieu\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
Languages:
Python: 3.12.6
Browsers:
Edge: Chromium (131.0.2903.86)
Additional context (optional)
No response
Metadata
Metadata
Assignees
Labels
No labels