- Removes the Underscore.js dependency in favor of just inlining two rewritten helper functions.
- Fixes possible double emitting on Node v19+ due to its global HTTP agent enabling keep-alive.
- Increases the upper-bound on Underscore.js dependency to v1.13 (inclusive).
Thanks, Martin Caruso, for the heads-up.
- Fixes one test for Node v12.4.
- Fixes the socket "close" event on Node v12.16.3.
- Adds compatibility with Node v10.15.1.
- Adds compatibility with Node v11.8.
- Adds compatibility with Node v11.1.
- Adds compatibility with Node v11.2.
- Adds Node v8.12, Node v9 and Node v10 support.
Thanks to Andreas Lind for help in debugging! Also thanks to him for providing mitm-papandreou while Mitm.js-proper incorporated his fixes.
- Fixes
getAsyncIderror on Node v8 when using anHttp.Agentwith thekeepAliveoption.
- Adds compatibility with Node v7.
Thanks, Eric Hacke, for the help!
- Fixes calling
Socket.prototype.refandSocket.prototype.unrefon the returned client and server sockets.
Thanks, Vincent Voyer, for the help!
- Adds compatibility with Node v6.4.
Thanks to Andreas Lind!
- Fixes writing to sockets returned by Mitm by postponing writing until the next
tick. Brings it in line with Node's behavior.
Thanks, Maarten Winter, for the help! - Fixes listening to the
connectevent aftersocketis emitted onClientRequest.
Thanks, Maarten Winter, for the help! - Fixes intercepting TLS connections to properly emit the
secureConnectevent and given a callback, bind it tosecureConnectrather thanconnect.
- Adds Io.js v3 support. Io.js v2.4.0 worked previously
Thanks, Vincent Voyer, for the help!
-
Returns an instance of
Tls.TLSSocketfromTls.connect.
The returned socket has bothencryptedandauthorizedset.
Thanks to Andreas Lind for the initialencryptedproperty patch!On Node v0.10
Tls.connectwill just return aNet.Socketwith theencryptedandauthorizedproperties set.
- Adds
Mitm.prototype.addListenerto look more like an EventEmitter.
Thanks to Alex Wolfe!
- Fixes tests by locking Mocha to v0.18.
For more info on Mocha's ill-behavior, see #1195.
- Fixes bypassing TLS connections.
Thanks to Roman Shtylman!
- Adds compatibility with Node v0.11.14.
- Fixes
Mitm.prototype.offto remove bound events with (mitm.off("request", listener)).
-
Adds bypass functionality to not intercept a particular outgoing connection and let it connect as usual.
Let a connection happen by callingbypasson the socket object given to theconnectevent:var mitm = Mitm() mitm.on("connect", function(socket) { socket.bypass() }) Net.connect({host: "example.org", port: 25})
-
Emits
connectandconnectionon Mitm with the options object given toNet.connect.
You can use that with the above bypass functionality to bypass selectively:mitm.on("connect", function(socket, opts) { if (opts.host == "sql.example.org" && opts.port = 5432) socket.bypass() })
- Adds Travis CI badge to the README.
-
Adds support for Node v0.10.24 and up.
-
Adds the
connectionevent to Mitm to get the remoteNet.Socket. You can use this to intercept and test any TCP code.
If you need the client side socket for any reason, listen toconnecton Mitm. -
Replaces the
Http.ClientRequestgiven to therequestevent on Mitm with a properHttp.IncomingMessage— just like a regular Node server would receive.
This ensures the requests you make are properly parseable according to HTTP specs (assuming Node.js itself is implemented according to spec) and also lets you assert on the content ofPOSTrequests.var mitm = Mitm() Http.request({host: "x.org"}).end() mitm.on("request", function(req) { req.headers.host.must.equal("x.org") })
-
Replaces Concert.js with Node's EventEmitter for now as I was not sure the extra features were required.
Remember kids, if in doubt, leave it out.
- Adds support for calling
Net.connectwithportandhostarguments.
- Does not store requests on an instance of
Mitmany longer. - Adds
socketevent toMitm. - Updated to work with Node v0.11.12.
- First private release.