Skip to content

chain proxy in case of error #123

Closed
Closed
@temsa

Description

@temsa

Something I try to do with node-http-proxy for some days now, is chaining proxies in case of error : I have multiple middle server. During a delivery, at least one server will be down for a while, so I'd like, if I get an ECONNREFUSED (or a hangup, but it happens for now in about 240s, I guess 2x 120s timeout, and I didn't get how to change this), I'd like my proxy to try another host instead of returning an error I could avoid<

I've created a first proxy, I listen to the "proxyError" event, which is fired, then I ask a second proxy to handle that request and try another equivalent host), it tries to handle the request then I have a "start" event as well for it, but it never writes to my response. My response is writable because I can write to it then call res.end().

I didn't get why for now. Is it possible to do?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions