Skip to content

ECONNRESET when POSTing to a proxy through connect server #496

Closed
@robsquires

Description

@robsquires

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.

  1. This does not happen with node 0.10.x (but we're proxying websockets as well so need 0.8)
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions