-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Feature request: ability to reject a connection to simulate ECONNREFUSED
#72
Comments
Hey, I'm glad you find Mitm.js useful. Hmm, is there anything in the current architecture that's making throwing any connection-time error hard? I suppose there are more connecting-related errors besides I suppose connecting errors have to be emitted as Thanks! |
For my specific use case, I need to refuse/error the connection before the
Unfortunately, I'm not overly familiar with the My original approach could potentially be made more robust if the |
I'm actually thinking whether it'd be possible to permit you to just throw whatever error you want from the |
Just a reminder, the first argument given to |
Since the |
@moll https://github.com/moll/node-mitm/pull/73/files now reflects your latest thoughts/feedback on throwing inside of the |
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 tosocket
, which is passed to theconnect
even callback.I'll submit a PR soon adding this functionality for your review.
The text was updated successfully, but these errors were encountered: