#How can I reliably detect when a POST request is aborted by the client in NestJS?

3 messages · Page 1 of 1 (latest)

supple monolith
#

How can I reliably detect when a POST request is aborted by the client in NestJS?

signal arch
supple monolith
#

I’m using Express as the HTTP driver in NestJS, and I’ve noticed that the http-proxy-middleware seems to hide or override the req events. Specifically, I cannot detect the aborted event on the original request because the middleware proxies the request and prevents it from emitting the standard event.

Is there any way to pass through the req events or listen for the aborted event in combination with http-proxy-middleware?