Attention : if you use the package to manage events sent by the server in node.js, then by directly calling response.end() package may send additional data after response.end() , which will lead to the server crashing with the error βRECORD after closing "
Instead of directly calling response.end() , my workaround was to call response.emit('close') , which allowed the package to handle closure.
Node.js documentation at http.ServerResponse> Event.close :
https://nodejs.org/api/http.html#http_event_close_1
source share