Node.js proxying made simple. Configure proxy middleware with ease for connect, express, browser-sync and many more. Powered by the popular Nodejitsu http-proxy.
Questions tagged [http-proxy-middleware]
176 questions
3
votes
2 answers
Does http-proxy-middleware work with Serverless Lambda?
I'm trying to proxy an external API through Serverless Lambda. Trying the following example for the code below: http://localhost:3000/users/1 returns 200 but body is empty. I must be overlooking something as http://localhost:3000/users/11 returns a…
![](../../users/profiles/13028295.webp)
Chandi Cumaranatunge
- 31
- 1
3
votes
1 answer
http-proxy-middleware + express + node.js - unable to redirect to end-point with client side certificate authentication enabled
I am using the http-proxy-middleware (https://www.npmjs.com/package/http-proxy-middleware) to implement a proxy to another REST API that has client-side certificate based authentication enabled (requestCert: true, rejectUnauthorized: true).
Client…
![](../../users/profiles/8567503.webp)
Neeraj
- 31
- 1
- 3
3
votes
2 answers
Handle WebSocket error with http-proxy-middleware
I'm using http-proxy-middleware to proxy some API endpoints to my Create React App development server.
I recently introduced a WebSocket endpoint, and I'm proxying it with the following code in setupProxy.js:
const proxy =…
![](../../users/profiles/2059996.webp)
Fez Vrasta
- 11,462
- 19
- 73
- 135
3
votes
1 answer
NodeJS - Edit and proxy a multipart/form-data request
I have a microservice that proxies every request adding one more field to it. With normal requests it's very easy, just add the field in the request.body and properly set the headers but for multipart/form-data requests I'm in trouble since days…
![](../../users/profiles/10313501.webp)
Andrea d'Argenio
- 91
- 1
- 7
3
votes
0 answers
Trying to deploy React app on heroku. App's api works fine locally but when I deploy to heroku the api doesn't work
I am using Node+Express for my back-end. At first I tried using "proxy": http://localhost:3001 in the react client's package.json but that caused an Invalid Host Header message when I tried to open my site on heroku.
I followed these insturctions…
![](../../users/profiles/9425473.webp)
srtalaie
- 31
- 2
3
votes
0 answers
How to fix timeout on express http-proxy-middleware
I am setting up an express server with http-proxy-middleware. When requesting from the proxy, the request goes on until it finally times out.
The URL I try to proxy is https://www.pegelonline.wsv.de/, especially a WFS it provides. I've read the…
![](../../users/profiles/11448323.webp)
quick_dough
- 51
- 6
3
votes
1 answer
http-proxy-middleware does't catch request from react app to API
Into my component
axios.post('/api/' + 'create', {
name: 'new name'
},
{
headers:
{
'Content-Type': 'application/json'
}
}
)
into setupProxy.js , created from third part…
![](../../users/profiles/11264566.webp)
GreenFed
- 41
- 5
3
votes
2 answers
http-proxy-middleware: return custom error instead of proxying the request
The http-proxy-middleware Nodejs module provides a way of re-target request using a function in the option.router parameter. As described here:
router: function(req) {
return 'http://localhost:8004';
}
I'll need to implement a process that…
![](../../users/profiles/1485926.webp)
fgalan
- 10,250
- 6
- 36
- 70
3
votes
1 answer
http-proxy-middleware - access to the static files
I'm trying to combine my static landing page with the express.js app (react.js single page app).
On my landing page, I set up proxy using http-proxy-middleware
My server.js for the static page looks like that:
var express = require('express');
var…
![](../../users/profiles/2784819.webp)
lipenco
- 1,268
- 5
- 15
- 28
3
votes
1 answer
webpack-dev-server proxy not working
My app uses a Python backend so when I'm running locally I need to proxy my requests to a different port than what Webpack is running on.
I've tried several different ways of making this work:
devServer: {
contentBase: outDir,
proxy: [
{
…
![](../../users/profiles/1215220.webp)
m0ngr31
- 671
- 9
- 26
3
votes
2 answers
Keep-alive option in webpack-dev-server with http-proxy-middleware?
We are using webpack-dev-server with http-proxy-middleware. Our Protractor test cases keep timing out. I suspect we need to have keep-alive set to true, but I don't see such an option either in webpack-dev-server nor in http-proxy-middleware. Is…
![](../../users/profiles/5739100.webp)
Anna T
- 101
- 6
3
votes
1 answer
http-proxy-middleware: unable to redirect localhost:9000 to localhost:8888 from nodejs to JettY
I have a Node.js (AngularJS app) application which is hosted at localhost:9000. The another part (legacy one - GWT superdev mode - JeTTy) is hosted at localhost:8888.
I would like to configure the http-proxy-middleware such that anything coming in…
![](../../users/profiles/1655313.webp)
Pradip
- 37
- 7
2
votes
1 answer
How to HTTP proxy for Next.js API requests
I have tried lots of things online but nothing is working so far.
First try (src/pages/api/proxy/[...slug].js):
import { createProxyMiddleware } from 'http-proxy-middleware';
// Create proxy instance outside of request handler function to avoid…
user15517565
2
votes
0 answers
Parallel connections performance issue with http-proxy-middleware express
I have setup a proxy server to an exist website with http-proxy-middleware, but the server is really slow, checkout the waterfall with Chrome development tools, a lot of requests have Stalled status.
waterfall
I try to increase maxSockets with…
![](../../users/profiles/3377975.webp)
keke
- 21
- 3
2
votes
1 answer
React http-proxy-middleware proxy not working
Hi I been trying the proxy solution to avoid the cors problems in myapp but it doesn't seem to work, i restarted my machine so many times and that made no difference. Basically myapp using fetchApi to call another domain (localhost:8080) which is a…
![](../../users/profiles/13382723.webp)
user13382723
- 39
- 4