Questions tagged [http-proxy-middleware]

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.

241 questions
3
votes
1 answer

http-proxy-middleware does not forward any of the path

I am trying to configure a proxy for my API requests using http-proxy-middleware, which the create react app docs suggest. I set up my proxy like this, in the setupProxy.js file: const { createProxyMiddleware } =…
3
votes
1 answer

React | http-proxy-middleware package not working

My application having multiple request to different API URL's request, when a particular component renders. I am facing the CORS issue since I am using multiple URLs' , so in order to avoid i haved installed http-proxy-middleware package. In…
3
votes
1 answer

Is there something wrong with making an http request in the ngOnInit of a component when using Angular Universal?

I have been running my Angular app via ng serve for development and was not experiencing any errors. When using SSR, however, I get an error in my server log whenever I load a component that makes an http request as part of it's ngOnInit method. Is…
3
votes
0 answers

http-proxy (reverse proxy) server hangs up in a random time

Problem: When I send a request after this log (memory), it shows "socket hang up (connResetException)" error. And the NodeJS server stops working. [1:0x330e8a0] 22724 ms: Mark-sweep 16.4 (25.2) -> 10.6 (29.9) MB, 3.3 / 0.0 ms (+ 0.1 ms in 2…
merry-go-round
  • 4,533
  • 10
  • 54
  • 102
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…
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…
3
votes
1 answer

How can I pass a proxied response when 'selfHandleResponse' is true?

I am running a development proxy-server where on startup I make a request for an auth token with our cluster architecture. However, this token expires after some time. Then instead of the developer restarting their proxy-server, I would like to make…
3
votes
2 answers

webpack config proxy request body logging

Webpack dev server proxy config documentation seen here: https://webpack.js.org/configuration/dev-server/#devserver-proxy says it uses http-proxy-middleware: https://github.com/chimurai/http-proxy-middleware#http-proxy-events Using the onProxyRes…
danday74
  • 52,471
  • 49
  • 232
  • 283
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…
fgalan
  • 11,732
  • 9
  • 46
  • 89
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…
lipenco
  • 1,358
  • 5
  • 16
  • 30
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: [ { …
m0ngr31
  • 791
  • 13
  • 29
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…
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…
2
votes
0 answers

Unable to hotReload on custom nextjs 12 server (unable to connect /ws://localhost:3000/_next/webpack-hmr)

I create a custom server my next js code with expressjs. everything is working find expect for hot-reload. here is the code for my custom server. app.prepare().then(() => { const server = express(); server.all("*", (req: Request, res: Response)…
emkay
  • 410
  • 1
  • 4
  • 12
2
votes
1 answer

React setupProxy not proxying request

I’m trying to setup a React web application using an asp.net core web API in two separate projects. I followed Microsoft’s guide for setting up the templates using two separate visual studio projects - Create an ASP.NET Core app with React -…
RamenNoodle
  • 107
  • 2
  • 8
1 2
3
16 17