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
0
votes
1 answer

How can I involve some validation before proxying to a websocket server with http-proxy-middleware?

I may be going about this all wrong. Goal: Recieve an https connection over apache, and do some validation before routing it to a websocket server. Return a 403 status code if invalid, and proceed with websocket connection if valid. I decided to…
user3345
  • 1
  • 1
0
votes
1 answer

How to return to client in onProxyReq of http-proxy-middleware

I'm trying to create a reverse proxy with express and http-proxy-middleware@2.0.1 with some built-in validation. The hope is that in the onProxyReq function, I can perform a check, and if it fails, I'd return the error to the caller instead of…
campbell.rw
  • 1,366
  • 12
  • 22
0
votes
1 answer

axios does not send post request to server via http-proxy-middleware

import axios from 'axios'; axios .post('api/email', { id: 1 }) .then((res) => { return res.data; }) server.js const express = require('express'); const next = require('next'); const { createProxyMiddleware } =…
Лукас
  • 213
  • 1
  • 4
  • 12
0
votes
1 answer

Making a proxy from the Nextjs api does not work with next-http-proxy-middleware

I'm trying to make a proxy out of the nextjs api, but it seems like it doesn't work. My pages/api/index.js looks like this: import { NextApiRequest, NextApiResponse } from 'next'; import httpProxyMiddleware from 'next-http-proxy-middleware'; const…
Janessa Labeur
  • 119
  • 1
  • 11
0
votes
0 answers

AWS Secrets manager and setupProxy.js http-proxy-middleware

I need to pull in configs from secrets manager before wiring up my proxies const express = require('express'); const { createProxyMiddleware } = require('http-proxy-middleware'); const { SecretsManagerClient, GetSecretValueCommand } =…
Zach M.
  • 1,188
  • 7
  • 22
  • 46
0
votes
1 answer

Javascript `http-proxy-middleware` onProxyRes and onProxyReq signature parameters

I'm new to Javascript, and it's a mind bending world to me. I have a [web app] that talks to a [proxy] that talks to a [web service]. In the signature, onProxyRes(proxyRes, req, res), where do each of the parameters originate? It seems like all…
Zak
  • 12,213
  • 21
  • 59
  • 105
0
votes
0 answers

HPM Error occurred while trying to proxy request (using react + express)

[HPM] Error occurred while trying to proxy request /api/users/ from localhost:3000 to http://localhost:5000 (ECONNRESET) I get this error while trying to do axios.post request, i'm running my app with concurrently (server with express and client…
0
votes
0 answers

Why is http proxy middleware not working in React?

This is my setupProxy.js: const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = (app) => { app.use( 'http://localhost:8000', createProxyMiddleware({ target: 'https://my-website.com', …
Keshav Bhatiya
  • 295
  • 3
  • 11
0
votes
0 answers

ECONNREFUSED - Proxying API requests from React

I am developing a MERN stack app. I am using the http-proxy-middleware package for proxying API requests. At the client side, inside "src" folder, I have a file called setupProxy.js. And the code inside is as follows: const { createProxyMiddleware }…
HKS
  • 526
  • 8
  • 32
0
votes
2 answers

Proxy Issue ENOTFOUND Create-React-App Http-Proxy-Middleware Express

I've run into a new problem when proxy my client requests from CRA to my express API server when in development. I get the following error message from HPM. And I can see it returns as 504 Gateway Timeout [HPM] Error occurred while trying to proxy…
0
votes
0 answers

What is the best practice with regards to handling HTTPS?

I've been learning more about hosting my own web server and specifically one with HTTPS, and was wondering what the best practice is. Should you handle the HTTPS in the application itself or should you make a separate proxy application to put…
Naomi
  • 65
  • 6
0
votes
0 answers

setupProxy.js path are not recognizing in reactjs application using http proxy middleware

I am implementing http proxy middleware in my react app , my setupProxy.js path's are not recognising . Below is my code please let me know if i am doing anything wrong. App component class App extends React.Component { test = () => { // I dont…
0
votes
1 answer

how to proxy socket.io to server with webpack-dev-server

Node:v12.19.0 Egg.js:v2.27.0 create-react-app: v4.0.0 http-proxy-middleware: v1.0.6 socket.io-client: v2.3.1 react client: import io from 'socket.io-client'; const socket = io({ transports: ['websocket'] }); socket.on('connect', () => { …
0
votes
1 answer

should i use a proxy middleware on production?

I separated my frontend from my backend and I am configuring my frontend part. I am doing API requests to the backend with a proxy middleware in production now and my question is, can it harm my frontend app in anyway? is there anything why I…
Deniz
  • 1,435
  • 14
  • 29
0
votes
1 answer

Webpack dev server proxy router option doesn't work

I'm setting up an application using the Vue CLI. I've come to configuring the proxy of the webpack-dev-server to proxy requests to a certain endpoint. Which endpoint to proxy to differs based on certain request parameters. According to the…
Nikolaj Dam Larsen
  • 5,455
  • 4
  • 32
  • 45