First off -- thank you for the great package! I've already found it very useful after just a short usage period.
For my use case, I am looking to be able to simulate a connection failure, such as ECONNREFUSED. I don't believe this functionality currently exists.
What I would recommend is a reject() method be added to socket, which is passed to the connect even callback.
mitm.on("connect", function (socket) {
socket.reject();
});
I'll submit a PR soon adding this functionality for your review.