moll / node-mitm

Intercept and mock outgoing Node.js network TCP connections and HTTP requests for testing. Intercepts and gives you a Net.Socket, Http.IncomingMessage and Http.ServerResponse to test and respond with. Super useful when testing code that hits remote servers.
Other
637 stars 48 forks source link

which port does it listen? #30

Closed zszszsz closed 8 years ago

zszszsz commented 8 years ago

and can I change this?

zszszsz commented 8 years ago

actually i am trying to use this as http/https mitm proxy

moll commented 8 years ago

Mitm.js hooks into Node.js in its outgoing TCP connection layers, so no real TCP connections are involved. You could get the sent data and proxy it to another real host I imagine. You'd have to ensure you call bypass (an example is in the README) on the real host when proxying, though!

moll commented 8 years ago

By no real TCP connections I mean it captures everything — every host, every port.

zszszsz commented 8 years ago

thanks a lot for pointing out my misunderstanding of this project

zszszsz commented 8 years ago

so it is the mitm of all the node scripts running instead of all the processes of the machine, which means it can not be the mitm of the browser, have I got it right?

moll commented 8 years ago

Yep. It intercepts connections only from within the same Node.js process its running in. It's mostly a tool for testing JavaScript.

moll commented 8 years ago

Anything else I can help with?

zszszsz commented 8 years ago

thank you very much. I was afk several days ago and sorry for not replying that(>_<)