- 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
getAsyncId
error on Node v8 when using anHttp.Agent
with thekeepAlive
option.
- Adds compatibility with Node v7.
Thanks, Eric Hacke, for the help!
- Fixes calling
Socket.prototype.ref
andSocket.prototype.unref
on 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
connect
event aftersocket
is emitted onClientRequest
.
Thanks, Maarten Winter, for the help! - Fixes intercepting TLS connections to properly emit the
secureConnect
event and given a callback, bind it tosecureConnect
rather thanconnect
.
- Adds Io.js v3 support. Io.js v2.4.0 worked previously
Thanks, Vincent Voyer, for the help!
-
Returns an instance of
Tls.TLSSocket
fromTls.connect
.
The returned socket has bothencrypted
andauthorized
set.
Thanks to Andreas Lind for the initialencrypted
property patch!On Node v0.10
Tls.connect
will just return aNet.Socket
with theencrypted
andauthorized
properties set.
- Adds
Mitm.prototype.addListener
to 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.off
to 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 callingbypass
on the socket object given to theconnect
event:var mitm = Mitm() mitm.on("connect", function(socket) { socket.bypass() }) Net.connect({host: "example.org", port: 25})
-
Emits
connect
andconnection
on 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
connection
event 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 toconnect
on Mitm. -
Replaces the
Http.ClientRequest
given to therequest
event 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 ofPOST
requests.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.connect
withport
andhost
arguments.
- Does not store requests on an instance of
Mitm
any longer. - Adds
socket
event toMitm
. - Updated to work with Node v0.11.12.
- First private release.