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

Other response types (302)

Open acklenx opened this issue 6 years ago • 0 comments

Is it possible to send a 302 REDIRECT response instead of any other [body] content? I don't think I directly have a refrence to the response object, so I can't write a header. I'm currently using a meta-refresh tag, but that just seams wrong.

For example with the built in http server I could do something like this the send a redirect

const server = http.createServer( ( req, res ) => { res.writeHead( 302, { 'Location': 'https://wwwgoogle.com/' } ); res.end(); } );

acklenx avatar Jun 02 '18 21:06 acklenx