Description
We have written a proxy to authenticate http requests to several servers, following the recommended design pattern:
https://github.com/nodejitsu/node-http-proxy#proxy-requests-within-another-http-server
We are using connect middleware
within this proxy to process cookie authentication and relay this internally to the servers via queryString parameters. The middleware in use is:
connect.urlencoded
connect.multipart
connect.cookieParser
connect.session
connect.csrf
Everything works ok for GET requests.
I'm having trouble with POST requests. Originally the requests were just hanging but I was able to resolve that using the httpProxy.buffer(req)
.
During a POST response the request is forwarded to the backend, the backend responds and then the proxy throws { [Error: socket hang up] code: 'ECONNRESET' }
.
I've done some digging around.
- This does not happen with node 0.10.x (but we're proxying websockets as well so need 0.8)
- This doesn't happen when we proxy without connect middleware processing the request
Can anyone offer any advice?
connect : ~2.9.0
http-proxy : ~0.8.7
node : 0.8.24
Many thanks