1

I'm using nodejs http-proxy-middleware to forward requests.

const my_proxy = httpProxy({
    target: http://my-service:80,
    changeOrigin: true,
    onProxyReq: (proxyReq, req, res) => {
         proxyReq.setHeader('auth-source', my_auth_source)
    })
})

For request comming from other nodejs Express application, everything is fine.

My client asked for a c# application; so I'm using c# HttpWebRequest with RequestStream.write() to send request to my proxy.

However, my httpProxy throw a Headers already set error.

If I remove the RequestStream.write() part, and send a request without body, everything is fine as well.

What am I missing. Do I need to enable an option to authorize my request to be forwarded ?

Thank you

Maxime VAST
  • 540
  • 6
  • 22

0 Answers0