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
636 stars 48 forks source link

fix: make mitm work on iojs #23

Closed vvo closed 8 years ago

vvo commented 8 years ago

some of my libraries were not working in iojs. showing

TypeError: this._handle.getSession is not a function
    at TlsSocket.TLSSocket.getSession (_tls_wrap.js:609:25)
    at TlsSocket.<anonymous> (https.js:77:50)
    at TlsSocket.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at TlsSocket.emit (events.js:166:7)
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)

So let's add this function.

xvyosl

moll commented 8 years ago

Haha, good one. Thanks, man! Mind replacing the \n\n-s in the empty function body with just a {}? Dunno if a comment above is necessary to now note that neither you nor me know what we're doing with getSession. ^_^

vvo commented 8 years ago

ok @moll done!

moll commented 8 years ago

Thanks again! I snooped around a little and it seems only the TLSSocket needs a getSession. Moved it there. ;) Will make a release right after it passes on Travis.

moll commented 8 years ago

v1.2.0 up. ✌️

vvo commented 8 years ago

Niiiiiice