From b3d1e504f4a3a4c44be3ca53b2aa44282fc391df Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 7 May 2013 11:55:12 -0700 Subject: net: emit dns 'lookup' event before connect net.connect() and net.createConnection() now emit a 'lookup' event after resolving the hostname but before connecting. Fixes #5418. --- lib/net.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/net.js b/lib/net.js index 4affa8d754..a86ca85d12 100644 --- a/lib/net.js +++ b/lib/net.js @@ -860,6 +860,8 @@ Socket.prototype.connect = function(options, cb) { var host = options.host; debug('connect: find host ' + host); require('dns').lookup(host, function(err, ip, addressType) { + self.emit('lookup', err, ip, addressType); + // It's possible we were destroyed while looking this up. // XXX it would be great if we could cancel the promise returned by // the look up. -- cgit v1.2.1