-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch proxy error? #264
Comments
In this example you will see the use of |
Worked like a charm, thx. |
This does not work well for the RoutingProxy. If I get ECONNRESET from the backend server, doing res.writeHead(500) in the proxyError handler will give me the "Can't render headers after they are sent to the client." error. Any ideas? EDIT: Actually, the proxy already resets the connection for me, but does not give me the alternative to call res.send(500) |
@alum this is expected. When you start proxying and the backend server sends the headers and then breaks the connections, the headers were already proxied back to the client. You have to catch the |
Hi, i've met this error in my proxy, i follow your guide to catch the error like this: var proxy = new httpProxy.RoutingProxy(); But the proxy still throws the error, and i can't caught it. |
So it's actually not the proxy that's throwing that error, but rather the response object. Also, there is not event called "Can't render headers after they are sent to the client." Most events are called things like "error" or "finish". |
Hi all, is there any way to identify which backend server failed to serve the request, so that we can mark that server as down. |
@arjunrp |
@alum thanks for the reply, i have got another solution |
Is there a way to catch proxy error? I mean, if the target didn't respond or isn't availabe..
I was thinking about something like this:
The text was updated successfully, but these errors were encountered: