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.

176 questions
11
votes
1 answer

How to enable and view create-react-app proxy logs?

How can I view detailed logs of all requests and responses being handled by the proxy used by create-react-app? I don't only want to log some endpoints. Instead, I want to see everything, in as much detail as possible, about what's going through the…
11
votes
3 answers

Use angular-cli with multiple path proxy matching

How can I define multiple paths to proxy in my proxy.conf.json? The angular-cli proxy documentation on github looks like you can only have one path (/api): { "/api": { "target": "http://localhost:3000", "secure": false } } But when I…
Hans
  • 573
  • 1
  • 6
  • 22
9
votes
1 answer

CRA 2.0 How to setup proxy in React?

In CRA 2.0 proxy property on the package.json does not work. After some research, I came across an article suggesting to use http-proxy-middleware. I created an setupProxy.js in the src of my client folder(React side). That contains the following…
Unity Hour
  • 498
  • 6
  • 19
9
votes
1 answer

Log request/responses bodies with http-proxy-middleware

I'm using http-proxy-middleware to implement a transparent proxy. I'd like to do request/response inspection. I mean, I'd like to print in a text file request/responses that go through the proxy whithout do any modifying on them. Up to now, what…
fgalan
  • 10,250
  • 6
  • 36
  • 70
7
votes
2 answers

Proxied requests other than GET are hanging with NestJS and http-proxy-middleware

Example code is available on https://github.com/baumgarb/reverse-proxy-demo The README.md explains how you can re-produce the issue if you clone the repo. I have an API Gateway and a downstream service which returns todos (TodosAPI). A client goes…
baumgarb
  • 1,416
  • 1
  • 17
  • 23
5
votes
3 answers

Create React App http-proxy-middleware not working

So I've set up my proxies on my create-react-app application using http-proxy-middleware. I'm sure I've followed the instructions to the letter, but I keep getting a 404 every time I try to click the relevant link. I'm using create-react-app…
Chris
  • 1,763
  • 5
  • 27
  • 41
5
votes
1 answer

how to set proxy by request hostname with http-proxy-middleware and express?

I want to configure proxy with http-proxy-middleware and express . The rule is a mapping of hostname, exmaple: http://123.com >> http://localhost:3000/123 http://456.com >> http://localhost:3000/abc I have tried like this: import express from…
Rife
  • 191
  • 2
  • 13
5
votes
2 answers

How to setup proxy settings for a website in production

I have developed a website in angular and have the following proxy settings in proxy.conf.js file. const proxyConfig = [ { context: '/web/api/webclients/**', target: 'https://10.109.102.109', changeOrigin: true, secure: false }, …
user2347528
  • 508
  • 7
  • 20
4
votes
1 answer

How to proxy to many different targets using http-proxy-middleware?

In the http-proxy-middleware library, the documentation states that you can use the target option to specify where you would like to proxy the request. However, they also allow you to use the router option to specify a function that will be used to…
Matt Hintzke
  • 6,737
  • 14
  • 47
  • 102
4
votes
3 answers

Zero response through http-proxy-middleware

I am trying to debug a proxy in Express, using http-proxy-middleware, but no matter what I do I get absolutely zero response. The endpoint sends the response but it is never returned by the proxy and the onProxyRes event is never triggered. Also the…
ViggoV
  • 1,801
  • 2
  • 18
  • 22
4
votes
1 answer

Setup Vue.js (vue-cli) hot reloading in WordPress plugin in /wp-admin

I'm relatively new to Vue.js, but not to Javascript/jQuery, and I've been doing pretty deep work with WordPress for about 8 years. I've spent way too many hours trying to configure a WordPress plugin built with vue-cli to hot reload components in…
slowFooMovement
  • 425
  • 4
  • 12
4
votes
3 answers

How do you configure a Webpack dev server to serve a specific folder while running the rest of the site through a different server?

Some quick background: My company's site runs off a CMS with the CMS handling all routing. There are no html files, only razor files (.cshtml). While redoing the site from scratch is what I'd prefer to do, it's not an option, so I'm attempting to…
3
votes
0 answers

createProxyMiddleware not working on Azure Webapp

I'm running an Angular Universal application that is talking to an API. Now I'm trying to set up a proxy in the Universal server that proxies API requests to the actual API server: server.use(['/api', '/sitemap.txt'], createProxyMiddleware({ …
3
votes
0 answers

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

Set up proxy server with multiple targets?

I have 2 express servers: api1 api2 Both are accessed locally using: http://localhost:3000/news http://localhost:3001/stock My aim: Access both express servers endpoints from a Proxy server on http://localhost:8008 My Issue: I can only hit the…
cgd
  • 57
  • 5
1
2 3
11 12