Questions tagged [node-http-proxy]

A full-featured http proxy for node.js

271 questions
0
votes
0 answers

Create a HTTPS Proxy for arbitrary external urls

I want to create a simple proxy for requests to arbitrary websites with Node.js (http-node-proxy) (and TypeScript for my case). I know that several questions exist on this difficult topic, but none of them helped me so far. I tried: import axios…
Remirror
  • 692
  • 5
  • 14
0
votes
1 answer

issue with nestjs + fastify-http-proxy

I am trying to build a Nestjs api proxy (pass through). I found this package which is very simple to use: fastify-http-proxy. The problem is I don't know how to use this package within Nestjs. Does anybody here any experience with this,…
Zhiyuan Zhang
  • 41
  • 1
  • 5
0
votes
1 answer

nodejs http-proxy not passing URL

I'm using http-proxy module and I'm trying to send the request to port 1234 and gets its reply back. But in the apache logs I can see that request is only to /. The documentation says to use toProxy: true in order to pass the URL but it isn't…
0
votes
0 answers

Http proxy with https target

I'm trying to create my own proxy server in NodeJs with the library node-http-proxy the problem is that I want to create a http proxy server that will have the possibility to forward the request to a https target (ex. https://google.com). I know…
SaltyPotato
  • 192
  • 2
  • 14
0
votes
1 answer

node-http-server module to respond with index.html to any request

I have installed a node-http-server module. I launch it from myDir on localhost port 8000. In myDir I have index.html. If I request (from the browser) http://localhost:8000/ I get index.html, which is OK and good. If I request though…
Paul Steven
  • 93
  • 4
  • 13
0
votes
0 answers

Webpack-dev-server handle proxy header

I have an issue with webpack-dev-server when it proxys to my prod env. The production server sends me 'set-cookie' header but it is an array and I don't see it in dev-server's response in the browser. Also, when I debug I see a lot of headers…
0
votes
1 answer

http-proxy to cloudfront results in 403 error

I have a series of serverless next.js apps running on AWS that I am serving at subdomains, and I want to proxy them to subdirectories on my main domain. So, for example, the app at foo.example.com/foo/ should appear at www.example.com/foo/. I've…
0
votes
1 answer

hanging POST requests in Nodejs

I'm using expressjs to create and API. I also have a proxy server to direct requests to my API Server, as follows: But on the API server the body of POST and PUT requests are unable to parse and the server hungs. // on proxy server const httpProxy =…
Kxng Kombian
  • 467
  • 4
  • 13
0
votes
2 answers

how to use node-http-proxy inside AdonisJS controller

I am trying to use node-http-proxy inside an AdonisJS controller, but I get the error The "url" argument must be of type string. Received type function The line causing the error is the proxy.web(request, response, { target: urlToProxy }); async…
PrestonDocks
  • 4,851
  • 9
  • 47
  • 82
0
votes
1 answer

Proxy target route to invalid url

I am trying to get http-proxy-middleware working, what I am trying to achieve is having multiple nodejs apps running and then having the proxy app as a reverse proxy server. The problem I encounter is when I press a link on a proxied app, here's my…
0
votes
1 answer

encodeURIComponent on dynamic request url, node.js

I am requesting an index.djvu that fires requests for documents by id. The requests id that the index.djvu fires is Base64 encoded e.g document/page_1_1_1_k21g_MjE4MGstMTAvMTE=.djvu where the id is MjE4MGstMTAvMTE=. I need to encode the id before…
Sveed
  • 13
  • 5
0
votes
1 answer

proxyReq.setHeader can not set headers after they are sent

i am building a node.js proxy and i want to add a conditional header proxy.on('proxyReq', (proxyReq, req, res) => { const realIP = parseHttpHeader(req.headers['x-real-ip'])[0]; const path =…
0
votes
1 answer

Modify node-http-proxy request body

I'm using node-http-proxy to try and proxy a request in my node/express web server. I'm attempting to append a body to a particular request at the route level, but the response I'm getting is indicating that the req.body doesn't exist. const proxy =…
Himmel
  • 3,629
  • 6
  • 40
  • 77
0
votes
1 answer

Proxied HTTP response being modified

I have a gulpfile that launches a dev proxy server. gulp.task('dumbserver', ()=> { const express = require('express'); const httpProxy = require('http-proxy'); const app = express(); const proxy = httpProxy.createProxyServer(); …
Ruan Mendes
  • 90,375
  • 31
  • 153
  • 217
0
votes
1 answer

Using Nginx, node-http-proxy to mask IP addresses

First of all, I'd like to apologize for the long post! I'm almost close to figuring everything out! What I want to do is to use node-http-proxy to mask a series of dynamic IPs that I get from a MySQL database. I do this by redirecting the…
Jose A
  • 10,053
  • 11
  • 75
  • 108