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
2
votes
0 answers

How to catch proxy response and redirect using http-proxy-middleware?

I have webpack-dev-server serving static files. (localhost:4000) I have backend server serving api request. (localhost) Before that, there is a authentication with idp provider. when I visit localhost:4000, it gets proxied into localhost for…
2
votes
0 answers

http-proxy-middleware is not working in production but in localhost

I used http-proxy-middle for proxying my api domain in order to bypass CORS issue. My code works in localhost, but when it is not working in my live domain. My code is: const proxy = require('http-proxy-middleware'); app.use( '/api', …
Kevin
  • 55
  • 2
  • 11
2
votes
1 answer

Nodejs proxy request coalescing

I'm running into an issue with my http-proxy-middleware stuff. I'm using it to proxy requests to another service which i.e. might resize images et al. The problem is that multiple clients might call the method multiple times and thus create a…
Gekkie
  • 996
  • 9
  • 24
2
votes
2 answers

Configuring setupProxy.js using http-proxy-middleware

I am trying to configure a proxy server ( setupProxy.js ) within a create-react-app using HTTP-proxy-middleware to get access to a weather data API ( api.darksky.net ). I followed the steps within the React documentation (…
kelly_james
  • 21
  • 1
  • 1
  • 3
2
votes
0 answers

http-proxy-middleware not using path

Even when I use the sample provided: var express = require('express'); var proxy = require('http-proxy-middleware'); var app = express(); app.use('/api', proxy({target: 'http://www.example.org', changeOrigin: true})); app.listen(3000); The output…
that_guy
  • 2,313
  • 4
  • 33
  • 46
2
votes
0 answers

Set up Webpack Browsersync proxy when sitting behind a http proxy

I want to set up a browsersync proxy in order to inject CSS and Javascript to an arbitrary website. However, I started to create a simple proxy with browsersync trying to serve me my _custom.css file. var browserSync =…
Fl0R1D3R
  • 862
  • 2
  • 11
  • 22
1
vote
1 answer

Is 'setupProxy.js' just some kind of "magic" file name in React apps?

I'm trying to adapt an older React app to work like an MS-generated client app I created. The newer one uses http-proxy-middleware in a script file named setupProxy.js so I am trying to do the same in the other. The thing is, I cannot see anywhere…
Joe
  • 5,394
  • 3
  • 23
  • 54
1
vote
0 answers

React http-proxy-middleware It works locally but not on the main server

I work locally with http-proxy-middeware and there is no problem After building the project with npm run build When I transfer the project to the main server, the proxy does not work anymore and gives a 404 error Thank you for your advice` const {…
1
vote
0 answers

Axios GET request with manual proxy setup (http-proxy-middleware) returns HTML instead of Json

I am trying to get data with ReactJS in frontend only (no access to backend). Due to Cors problems I am using manual proxy setup with http-proxy-middleware - file setupProxy.js in src folder. I do not want to use proxy directly in package.json. In…
Nitka
  • 11
  • 3
1
vote
0 answers

"http-proxy-middleware" does not work in production mode. (react)

my setupProxy.js const { createProxyMiddleware } = require("http-proxy-middleware"); module.exports = function (app) { app.use( createProxyMiddleware(`/API`, { target: "https://dev-api.id.com", changeOrigin: true, …
1
vote
0 answers

Parse request body and determine proxy target NodeJS http-proxy

Due to a use case, I am trying to first parse request body and then decide the proxy target. But whenever I am parsing req body, proxy does not work. it just becomes unresponsive. I tried bodyparser and reading from buffer as well, but any try to do…
1
vote
1 answer

http-proxy-middleware: pathFilter not working as expected

I am trying so setup a npm-based HTML development environment using two servers. One hosts my HTML app of static files (standard way: http://localhost:8080) while the other exposes an application api running…
nurrrb
  • 31
  • 4
1
vote
1 answer

http-proxy-middleware, dynamic target

I'm trying to setup a proxy in express js, i am using http-proxy-middleware, it works perfect with hardcoded target. server.use('/login', createProxyMiddleware({ target: 'https://pretest.test.example', changeOrigin: true, })) in this case if i…
Jake
  • 21
  • 3
1
vote
1 answer

Can't pass request body through next-http-proxy-middleware

I've been trying to create a frontend using nextjs for a backend I have running in Java. I'm using the npm package next-http-proxy-middleware and it seems that either my request body is being dropped or I'm using the package incorrectly. Here's the…
1
vote
3 answers

React App Not Loading When Using http-proxy-middleware

Alright, I've about reached the end of my sanity on this one. So, I have a basic React frontend w/ an Express backend. React is running off of localhost:3000, the backend is running off of localhost:3030. Following along on a guide for setting up…