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
0
votes
1 answer
http-proxy-middleware adds a '/' before query parameters
I want to consume an API using a proxy written in express. I use http-proxy-middleware for this. Here is the setup I have:
app.use(
createProxyMiddleware('/api', {
target: 'http://example.com/api/v2',
changeOrigin: true,
pathRewrite:…

George D
- 41
- 1
- 2
- 9
0
votes
1 answer
React: 404 Not Found with Proxy after deploying to IIS
I really need your help and advice on this, I have been searching for 2 weeks and I'am unable to resolve my proxy issues.
I'm setting up the below 'setupProxy.js' to bypass the CORS while requesting the API/Endpoints from the (Web Servers).
However,…

Raiden Choong
- 61
- 2
- 9
0
votes
0 answers
next.js with http-proxy-middleware post request file upload return 400 bad reqeust immediately
const res = await axios({
url: `http://localhost:3000/api/proxy/....`,
method: "POST",
headers: {
"Content-Type": "mutipart/form-data",
},
data: formData,
onUploadProgress: (progressEvent) => {
…

Geunho Jang
- 1
- 1
0
votes
1 answer
Socket.IO on Subdomain vhost and proxy
I'm trying to proxy socket.example.com:4000 to a websocket server mydomain.com:3000 but the client can also connect to the server through *.example.com:4000, It's like vhost has no effect and the proxy configuration is set globally. I don't want…

Jacqueline
- 53
- 2
- 5
0
votes
1 answer
Webpack Dev Server proxied GET returns empty JSON object when data is expected
I'm running a local instance of FoundryVTT which, among a lot of other things, serve two resources:
http://localhost:30000/modules/_dev-mode/lang/en.json (5.6 kB JSON)
http://localhost:30000/lang/en.json (24.9 kB JSON)
I have setup…

Linus
- 3,254
- 4
- 22
- 36
0
votes
1 answer
How to rewrite request path using http-proxy-middleware in a react app?
I am using http-proxy-middleware in my react app, where I have a setup like this:
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function(app) {
app.use(
"/api/v1",
createProxyMiddleware({
…

Dragon
- 1,194
- 17
- 24
0
votes
2 answers
How to bypass CORS policy when sending get/post request from React JS?
From my React JS app , I need to fetch data from servers in other domains.
However, I am prevented by CORS policy and not able to fetch the data.
Let us assume that my React app is running on localhost:3000 during the development.
I want to make…

A.G.Progm.Enthusiast
- 846
- 14
- 29
0
votes
0 answers
Transitioning react app from dev to production environment causes 401/unauthorized errors
I've been tasked with transitioning a development CRA build to work in production. Currently we use an api proxy in development with a setupProxy.js file as such:
const BACKEND_URL = process.env.BACKEND_URL
const { createProxyMiddleware } =…

heroesrule99
- 43
- 1
- 6
0
votes
1 answer
React App doesn't make proxy calls after deployed to azure
Simple setup:
React App created with create-react-app
ASP.NET Core web API - a couple of controllers (currently no security until I make it work)
Both the API and Application are deployed to Azure.
When I run the app locally with configured proxy…

Todor Paskalev
- 66
- 4
0
votes
0 answers
React getting index.html response instead of API data from GET/POST methods after deploying to IIS v10
I'm following the instruction on how to build react app in the IIS. URL
However, for some reason, all my API calls are getting 404 errors.
Any hints or advice would be appreciated!
I'm using a proxy in order to bypass CORS policy on specific…

Raiden Choong
- 61
- 2
- 9
0
votes
0 answers
API returns index.html instead of result when deployed to Prod (Proxy issue?)
So I'm building a react webapp that calls some methods deployed on a server.
I installed http-proxy-middleware and added the follow under src folder:
setupProxy.js
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports =…

Zok
- 355
- 2
- 15
0
votes
1 answer
Variable auth parameter for proxy-middleware
I tried to secure my ngrok tunnels with name and password but run in some problem on my proxy.
If I try to set the variable for that depended on the header from the request, similar to the router.
var optionsLogin = {
logLevel: 'debug',
…

justabithope
- 3
- 4
0
votes
2 answers
I have a cross-domain request problem about React
I have a problem. When I click the button, an error is reported on the page.
"Access to XMLHttpRequest at 'http://localhost:8000/hello' from origin
'http://localhost:3000' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is…

tong tian
- 11
- 4
0
votes
3 answers
Error: Cannot set headers after they are sent back to the client in express middleware
I am having issues while doing some complex stuff inside middleware. I know i should be getting this done in a route or some small function but I had no choice.
This is the entire middleware:
app.use(async function addReqUser(req,res,next) {
…

Saswat
- 180
- 4
- 13
0
votes
1 answer
Proxy Heroku App Running Next.js and Prisma Client
I am trying to use QuotaGuard Static IPs to host a Next.js application. The Next API routes are running Prisma which, in turn is making direct db requests to a protected Microsoft SQL Server.
The client has whitelisted my IP for local development…