node-http-proxy icon indicating copy to clipboard operation
node-http-proxy copied to clipboard

Re-send request to different URL based on initial response

Open FSchraufstetter opened this issue 6 years ago • 1 comments
trafficstars

Hi, the server I'm proxying the requests to responds with a 307 if we need to send the request to a different URL (and provides the host/path in the response header). I need to extract the information from the header, proxy the initial request to a different server, and return this response to the client. As far as I understand, the proxy.on(proxyRes)... method is unable to discard the response and initiate a new request. Is there any workaround for my problem? Thanks a lot! Frank

FSchraufstetter avatar Oct 29 '19 16:10 FSchraufstetter

try to set followRedirects = true which means you want to follow redirects

jullite avatar Feb 21 '22 12:02 jullite