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
1
vote
0 answers

React: Added http-proxy-middleware to get information from different API endpoints, but now I have a CANNOT /get error

I read this React-router urls don't work when refreshing or writing manually, and while it explained why I'm facing the issue, I'm not too sure what the best approach is here. I set up http-proxy-middleware as a workaround for pulling information…
elguapo
  • 155
  • 1
  • 14
1
vote
0 answers

http-proxy-middleware change headers asynchronously

I'm using http-proxy-middleware in NodeJS to proxy a PHP site that does authentication. The PHP site returns a header "saml-user-id". I use this saml-user-id to generate a token which I want to add as cookie. I need to lookup the user in the…
Hendrik Jan
  • 4,396
  • 8
  • 39
  • 75
1
vote
0 answers

http-proxy-middleware not working on Heroku

I made a front end SPA with create-react-app. I implemented http-proxy-middleware to solve CORS issues with api calls to https://api.deezer.com. The proxy works flawlessly locally, but it fails to add the headers after deploying to Heroku and the…
sarahm16
  • 123
  • 1
  • 11
1
vote
0 answers

NestJS proxy + standard route handling

I use NestJS app with http-proxy-middleware to proxy incoming request to the backend server. If incoming request matches the proxy config it will handle the request and send response directly to the client without invoking standard route handling…
Vladimir Prudnikov
  • 6,974
  • 4
  • 48
  • 57
1
vote
1 answer

Dynamic pathRewrite with createProxyMiddleware and create react app

I have the following in my Create React App as per https://create-react-app.dev/docs/proxying-api-requests-in-development/ src/setupProxy.js const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { …
1
vote
3 answers

I am having problem using http-proxy-middleware

I have two servers running in my backend, because of that I have to use the http-proxy-middleware package but I am encountering some problems. This is my code in the frontend which is running on localhost:3000 axios("/api2/login",data) …
Abhinav
  • 21
  • 1
  • 4
1
vote
2 answers

http-proxy-middleware proxy is not working in React js and Spring Boot project. GET API is return 415 status error

I'm using the http-proxy-middleware middle ware. Content-Type: application/json is must be add in API's headers while execute with postman. I added my API's header configuration in React. I think the error is caused by I dont send headers corrently.…
1
vote
0 answers

Express use fails if one path is a substring of another

I'm configuring a proxy (http-proxy-middleware) for dev server, using the following configuration app.use( /^\/(pathone|pathtwo|pathonetwo)/, createProxyMiddleware(...) ) This matches /pathone and /pathtwo correctly, but /pathonetwo is…
riv
  • 6,846
  • 2
  • 34
  • 63
1
vote
2 answers

Docker + Flask + React + Axios + http-proxy-middleware failing with "Error occured while trying to proxy to..."

I have an issue with http-proxy-middleware. My setup is I have my flask API and my React frontend both in docker containers, run from a docker-compose file. All works well. Flask is on localhost:5000 and react on localhost:3000 My Flask API is…
robster
  • 626
  • 1
  • 7
  • 22
1
vote
1 answer

http proxy middleware is not created proxies in my react app

I am implementing http proxy middleware in to my react app. I want to proxing qa or dev backend services urls from my local . Example of my dev login url below https://cors-anywhere.herokuapp.com/https://dev.sju.uk/auth/login my…
SakthiSureshAnand
  • 1,324
  • 16
  • 32
1
vote
0 answers

How to send and receive cookies by react js to a SAP server?

Let me try to explain a bit my current situation: I have to consume an api rest from SAP which I need to get a token and a X-CSRF-Token, both work well, I got them and the session cookies from SAP, until this point everything is ok. To consume the…
Victor Potes
  • 101
  • 1
  • 1
  • 8
1
vote
1 answer

How to make a bocking Request in NodeJS inside a http-proxy-middleware function?

I have a proxy server which modifies a specific type of POST Request before forwarding it to the Server. The Modification requires me to make a request to another server in order to get the new value that will be put in place of the old one in the…
1
vote
2 answers

Is there a way to call api with only different sub domains in React?

When I first did the React project, there was only one host domain api, so I used it by modifying the proxy value of the package file. (I prefer to use proxy because I suffered from cors problem.) Recently, http-proxy-middleware was used to use more…
Hojoong Kim
  • 93
  • 1
  • 8
1
vote
1 answer

Is there a reason http-proxy-middleware wouldn't proxy matching request?

I have a create-react-app front end that I need to proxy and change origin to my Flask socket-io back end during development to get around CORS. I have already set up http-proxy-middleware which I have done in past projects with success. My…
1
vote
1 answer

Update SetupProxy target dynamically

I am developing a tenant application with Django backend and React.js as a frontend framework. And using http-proxy-middleware to proxy the request to backend server. For different kind of tenants we need to update target value of…
Shakil
  • 4,520
  • 3
  • 26
  • 36