diff options
Diffstat (limited to 'lib/net.js')
-rw-r--r-- | lib/net.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/net.js b/lib/net.js index 41c1cacac5..cda613f2e2 100644 --- a/lib/net.js +++ b/lib/net.js @@ -26,12 +26,14 @@ const stream = require('stream'); const util = require('util'); const internalUtil = require('internal/util'); const { + isIP, + isIPv4, + isIPv6, isLegalPort, normalizedArgsSymbol, makeSyncWrite } = require('internal/net'); const assert = require('assert'); -const cares = process.binding('cares_wrap'); const { UV_EADDRINUSE, UV_EINVAL, @@ -1066,7 +1068,7 @@ function lookupAndConnect(self, options) { var localAddress = options.localAddress; var localPort = options.localPort; - if (localAddress && !cares.isIP(localAddress)) { + if (localAddress && !isIP(localAddress)) { throw new errors.TypeError('ERR_INVALID_IP_ADDRESS', localAddress); } @@ -1091,7 +1093,7 @@ function lookupAndConnect(self, options) { port |= 0; // If host is an IP, skip performing a lookup - var addressType = cares.isIP(host); + var addressType = isIP(host); if (addressType) { nextTick(self[async_id_symbol], function() { if (self.connecting) @@ -1775,9 +1777,9 @@ module.exports = { connect, createConnection: connect, createServer, - isIP: cares.isIP, - isIPv4: cares.isIPv4, - isIPv6: cares.isIPv6, + isIP: isIP, + isIPv4: isIPv4, + isIPv6: isIPv6, Server, Socket, Stream: Socket, // Legacy naming |