249 questions
0
votes
0
answers
89
views
Header not set by http-proxy-middleware
I am trying to add a header to an HTTP request as:
const { createProxyMiddleware } = require('http-proxy-middleware');
const express = require('express');
const app = express();
const API_KEY = '...
0
votes
0
answers
144
views
Node.js http-proxy-middleware: Proxy request hangs with 408 timeout, onProxyReq not triggered
I'm building an API Gateway using Node.js, Express, and http-proxy-middleware. All incoming requests are forwarded to different services based on dynamic routing logic.
I'm encountering a 408 Request ...
0
votes
1
answer
80
views
How to continue in case of the router is not satisfied using http-proxy-middleware?
I have a node.js / express project and I try to implement http-proxy-middleware like this :
const app = express();
...
// 1st : `/mainUrls/*` are processed by the main app
app.use("/mainUrls"...
0
votes
1
answer
29
views
Flask-JWT-Extended: Ensure Refresh Cookie is Sent Only on `/refresh` but also on URLs with prefixes like `/api/refresh`
I am using Flask with the flask-jwt-extended library for authentication, and I have encountered an issue with the refresh cookie. My setup includes:
Backend: Flask running with flask run on port 5000....
0
votes
0
answers
198
views
Problem with http-proxy-middleware and non localhost target
I've got a simple node proxy app that works exactly as I want when I proxy between to localhost ports with https. That is, https://localhost:5200/jokes to https://localhost:7172/jokes. I call it from ...
1
vote
1
answer
504
views
Modifying response body from target proxy through http-proxy-middleware
I am trying to modify HTML body response of proxied target url, but my res.send method is not executing because onProxyRes function is not waiting the proxyRes.on('end', () => { event.
const ...
-1
votes
1
answer
218
views
Facing setupProxy issue in my react application
I'm facing an issue in my react application where I have created setupProxy.js file in that I have added multiple environment url (.development, .test) . Development port is running "http://...
-1
votes
1
answer
233
views
changes made to my JavaScript files in a React project are not reflected in the UI when compiling using 'npm start'. Reflecting only when rebuilt
Initial issue faced:
"Invalid options object. Dev Server has been initialized using an options object that does not match the API schema"
TO resolve this issue added setupProxy.js inside src ...
0
votes
0
answers
97
views
express http-proxy-middleware upload not working
When i am uploading file from frontend with formdata as body of post request, Backend is returning 400 bad request.
const formData = new FormData();
formData.append("file", this....
0
votes
1
answer
394
views
Using an async preHandler function on @fastify/http-proxy creates a FastifyError: Reply was already sent
I have the current code for proxying.
const fastify = require('fastify')({ logger: true })
const fastifyHttpProxy = require('@fastify/http-proxy')
fastify.register(fastifyHttpProxy, {
upstream: ...,...
0
votes
0
answers
405
views
How to modify http-proxy-middleware TLS fingerprint?
I use http-proxy-middleware to access various web-sites, including those having TLS fingerprint checks. My problem is that the proxy's TLS fingerprint is not corresponding to the User-Agent header I'm ...
2
votes
3
answers
1k
views
Invalid frame header error in websocket using by Webpack Hot Update after I use setupProxy for websocket
Below error message is shown on my console.
After researching, I found that this error message is thrown from the initSocket function, which should be used by webpack hot update.
Below is my ...
2
votes
1
answer
160
views
ExpressJS not redirecting configured PATH
I am setting up a local proxy to redirect specific URLs to another server, I am running my expressJS server as my main server, I have another server running on a different port... My express JS config ...
0
votes
2
answers
825
views
How to handle redirect from proxied server in webpack-dev-server proxy?
I'm having a webpack-dev-server enabled with watcher and reload on every change.
This frontend dev server is in docker container, and is proxying everything to another docker container, backend, which ...
0
votes
1
answer
83
views
Socket.io 4 with express.js - query parameters missing in onconnection
The query object from the client is simply missing from the handshake object on the server.
On console.log(socket) at the client, query object is shown in _opts while opts looks like -
hostname: "...
1
vote
1
answer
1k
views
Rewrite Domain in Set-Cookie in Nextjs dev server
We use CORS + SameSite to prevent CSRF attack on the server side & Next.js build a static site with Apache mod_proxy, the Domain component is handled by Apache's ProxyPassReverseCookieDomain ...
0
votes
0
answers
262
views
Angular app converted @angular/ssr will not proxy requests to existing API
Angular app converted @angular/ssr application to dynamically render pages of type /page/:id and optimize SEO. I have an existing local API made with Go and Gin Routing, and it is running at http://...
0
votes
0
answers
79
views
Banno Plugin Servers hosted on localhost, with redirect URIs that are not localhost based
The Banno plugin servers are hosted on localhost on different ports (e.g. http://localhost:21770 and http://localhost:21771), however, the corresponding external App redirect URIs are not localhost-...
0
votes
0
answers
1k
views
http-proxy-middleware as a NestJS middleware creates a new instance for every request
I use http-proxy-middleware in a NestJS middleware to proxy / rewrite some requests. Problem is, for every request on that route, a new Instance of the Middleware Class is created. After a couple of ...
0
votes
1
answer
117
views
How to handle a script loading additional resources in React?
I'm developing a website in React using create-react-app. I'm using an external script for some features relating to credit card payment (Clover in this case). This script adds iframes to the page ...
0
votes
1
answer
1k
views
How to build a nodejs(express) proxy using http-proxy-middleware?
I try to proxy all interfaces of http://A.com to http://B.com. And then I want to change the result of interface '/api/v2'. But what i do is not worked for the interface '/api/v2'. My logs in proxyRes ...
0
votes
1
answer
414
views
DOM manipulation of proxy response in express node using Cheerio and http-proxy-middleware
I've setup proxy server in express Node, which is working fine.
const express = require('express');
const { createProxyMiddleware } = require('http-proxy-middleware');
const app = express();
// ...
1
vote
1
answer
787
views
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 ...
0
votes
1
answer
2k
views
Http-proxy-middleware with ExpressJS returns error while proxying to http://jsonplaceholder
I am basically following the code in here.
I generate my Express project using npx express-generator
In my routes/index.js I do this
var express = require("express");
var router = express.Router()...
0
votes
0
answers
150
views
Node Proxy Failing on Login
I've created a very basic Node Express Proxy server using the http-proxy-middleware module. I'm able to reach the target url which is a login page. However when I try to login to the page I get a '400 ...
0
votes
1
answer
216
views
For load balancing which is preferable Node Clusters or using axios / http-proxy-middleware and Node container is dockerized
code here
axios for load balancing
I am trying out the concepts of load balancing and I am not sure which method is suitable and works well when I dockerize the Node application
I haven't tried any ...
0
votes
1
answer
1k
views
How to use http-proxy-middleware with express router in Nodejs
I am trying to use http-proxy-middleware in NodeJs. It is not working. I am working on node version 18.
const express = require('express');
const router = express.Router();
const { ...
0
votes
1
answer
1k
views
Does http-proxy-middleware always forward cookies along with the request?
I was setting up a nodejs api with 2 different react front ends and found that I kept running into CORS issues.
To get around this I created 3 servers. 2 for each of the front ends and 1 for the ...
0
votes
2
answers
6k
views
Use http-proxy-middleware with express to access a protected resource
I'm attempting to proxy a remote, protected resource.
The proxy doesn't work, so I'm guessing that I have not configured it correctly.
server.js:
const express = require('express');
const { ...
0
votes
0
answers
138
views
Axios React cors issue on product
my third party axios requests works properly on local mode properly thanks to "http-proxy-middleware", but after i build and deploy it, axios requests gives homepage html as response.
...
1
vote
0
answers
198
views
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 ...
1
vote
1
answer
2k
views
How do I generate custom response when proxy error in http-proxy-middleware
TLDR: how do I customize the "Error occurred while trying to proxy: localhost:3000/" in http-proxy-middleware?
I'm using the node package http-proxy-middleware as a proxy.
I have some ...
0
votes
1
answer
2k
views
ReactJS http-proxy-middleware request header not set properly
TL;DR: How to actually change a request header in http-proxy-middleware?
To get around some CORS errors I set up a local proxy using the http-proxy-middleware module. In addition to setting the mode ...
1
vote
0
answers
586
views
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 ...
1
vote
1
answer
840
views
Express & HPM - 404 Not Found & Client Disconnected w/ PVE xterm websocket
I am using Express and HPM to proxy all requests to my website. This is all wrapped together into a little tool I call ws-proxy (ws for web server, not websocket).
One of the things proxied is my PVE/...
0
votes
0
answers
2k
views
proxy setup with http-proxy-middleware, unexpected error occurs periodically
As a part of my React (front) / Express (backend) project, I have a web crawler that crawls buffer, decodes then obtain desired data using cheerio.
(Just to clarify, I am not using any data obtained ...
-1
votes
1
answer
2k
views
How can I connect to my backend server from my frontend dev server react
I am running my node backend on port 8000 and my dev server front end on port 9002. Ive tried a few ways to proxy to my backend when running dev, but all seem to fail (maybe because i also have
"...
-1
votes
1
answer
280
views
How can I create a global middleware to validate subscriptions?
For the architecture that is intended to be used for the project, it is necessary to have a middleware that validates if a user has an active subscription, that is, if he has already paid for it.
3
votes
0
answers
931
views
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(...
1
vote
1
answer
1k
views
Can't get React http-proxy-middleware to work
I've struggled for hours now trying to get http-proxy-middleware to work but what ever I do it just won't work.
This is my setUp.js file (located in src)
const { createProxyMiddleware } = require('...
1
vote
1
answer
8k
views
TypeError: Cannot read properties of null (reading 'split')
I have an angular application which is throwing me this error when I try to access it.
TypeError: Cannot read properties of null (reading 'split')
at required (/Users/.../node_modules/requires-...
1
vote
1
answer
304
views
Why is react-admin ignoring my proxy configuration?
I am in the middle of upgrading my project from react-admin v3 to v4. I am currently stuck because the proxy configuration line in my package.json file is not working. It was working fine in v3.
Here ...
2
votes
1
answer
721
views
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 -...
2
votes
0
answers
734
views
"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: "...
1
vote
0
answers
573
views
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 ...
1
vote
1
answer
2k
views
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 ...
0
votes
1
answer
5k
views
Websockets not working with http-proxy-middleware
I'm trying to configure websockets through http-proxy-middleware. I'm using Docker with NodeJS and React with react-create-app.
const { createProxyMiddleware } = require('http-proxy-middleware');
...
3
votes
1
answer
3k
views
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 { ...
0
votes
1
answer
225
views
Can't receive a response message when using proxy-middleware between react ui and express backend
I see that the request sent from the ui created using React is forwarded to the backend, but I can't get the response from the ui. There may be details that I missed as I am very new to these issues, ...
0
votes
0
answers
844
views
How to pass Corporate proxy headers to http-proxy-middleware npm
I have a code to call proxy api from Angular using express server.
While using the following code I'm getting error as can't set header after they sent.
am I doing something wrong here?
const {...