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]
241 questions
5
votes
1 answer
Modify http proxy request by adding auth token returned from another request
I'm using the http-proxy-middleware (https://github.com/chimurai/http-proxy-middleware#http-proxy-events) to implement a simple proxy (call it my-proxy/) to another REST API (call it /rest-api) that requires the user to pass an auth token in the…

Will
- 2,858
- 6
- 33
- 50
5
votes
1 answer
how to set proxy by request hostname with http-proxy-middleware and express?
I want to configure proxy with http-proxy-middleware and express .
The rule is a mapping of hostname, exmaple:
http://123.com >> http://localhost:3000/123
http://456.com >> http://localhost:3000/abc
I have tried like this:
import express from…

Rife
- 487
- 2
- 7
- 18
5
votes
3 answers
Zero response through http-proxy-middleware
I am trying to debug a proxy in Express, using http-proxy-middleware, but no matter what I do I get absolutely zero response. The endpoint sends the response but it is never returned by the proxy and the onProxyRes event is never triggered. Also the…

ViggoV
- 2,133
- 2
- 20
- 22
5
votes
2 answers
How to setup proxy settings for a website in production
I have developed a website in angular and have the following proxy settings in proxy.conf.js file.
const proxyConfig = [
{
context: '/web/api/webclients/**',
target: 'https://10.109.102.109',
changeOrigin: true,
secure: false
},
…

user2347528
- 580
- 1
- 8
- 22
5
votes
0 answers
http-proxy-middleware: accessing 127.0.0.1 instead of localhost, causing ECONNREFUSED
Using webpack2 to compile on the fly an angular application, I configured devServer this way:
proxy: {
'/api': {
target: 'http://localhost:52163'
}
}
The target of the proxy is a IIS Express server. After upgrading from Visual…

Fabien
- 549
- 7
- 22
4
votes
1 answer
createProxyMiddleware not working on Azure Webapp
I'm running an Angular Universal application that is talking to an API. Now I'm trying to set up a proxy in the Universal server that proxies API requests to the actual API server:
server.use(['/api', '/sitemap.txt'], createProxyMiddleware({
…

Bart van den Burg
- 2,166
- 4
- 25
- 42
4
votes
1 answer
how to make http-proxy-middleware connect to localhost server from create-react-app
How do connect to multiple APIs with React App?
Create-react-app with Express backend, using http-proxy-middleware.
Demo bug : https://github.com/svgpubs/nodeproxy.git
I am using http-proxy-middleware to try to connect a demo React App to two…

NicoWheat
- 2,157
- 2
- 26
- 34
4
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…

keke
- 41
- 4
4
votes
1 answer
"ERR_HTTP_HEADERS_SENT:Cannot set headers after they are sent to the client" while http-proxy-middleware combined with https-proxy-agent
The Node (Express JS) middle-ware uses http-proxy-middleware to proxy requests and responses between client (probably Chrome browser) and jira server. It also uses https-proxy-agent to add proxy agent as the host server requires proxy to access Jira…

Sathish
- 346
- 5
- 9
4
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 =…

Fez Vrasta
- 14,110
- 21
- 98
- 160
4
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…

quick_dough
- 76
- 1
- 6
4
votes
2 answers
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…

GreenFed
- 57
- 2
- 7
4
votes
1 answer
Setup Vue.js (vue-cli) hot reloading in WordPress plugin in /wp-admin
I'm relatively new to Vue.js, but not to Javascript/jQuery, and I've been doing pretty deep work with WordPress for about 8 years. I've spent way too many hours trying to configure a WordPress plugin built with vue-cli to hot reload components in…

slowFooMovement
- 498
- 5
- 14
3
votes
1 answer
How to apply createProxyMiddleware in webpack?
How to apply createProxyMiddleware in webpack?
I have a webpack.config.js with default proxy:
// development config
require('dotenv').config()
const package = require('../../package.json')
const { merge } = require('webpack-merge')
const webpack =…

Learner
- 417
- 6
- 24
3
votes
0 answers
How to setup setupProxy.js file in react typescript project
I'm using React CRA-typescript template and want to configure proxy manually using http-proxy-middleware
This is my setupProxy.js
And this is my fetch request
But proxy is not redirecting to correct url and still using localhost.
This how request…

Ramy
- 43
- 1
- 3