How to pass ECONNREFUSED through the proxy #717
Unanswered
martinschayna
asked this question in
Q&A
Replies: 1 comment
-
What you're trying to do, contradicts with the error code You'll only make debugging more difficult by actually returning a response with the ECONNREFUSED error... Returning a 502 might be a better practice and log the real ECONNREFUSED for tracing and debugging.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a proxy that rewrites requests to couple of servers on the same machine running on different ports. It should be transparent as possible, so when some of target servers aren't running, I want to pass ECONNREFUSED error to the client.
That should be possible inside
onError
handler, default handler looks like that:but obviously, that's not the same, client gives 504 instead of error. What could I put into
onError
handler to simulate original error in client? Thanks.Beta Was this translation helpful? Give feedback.
All reactions