You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
529 B

'use strict';
const common = require('../common');
const assert = require('assert');
const net = require('net');
const server = net.createServer(function(client) {
client.end();
server.close();
});
server.listen(0, '127.0.0.1', common.mustCall(function() {
net.connect(this.address().port, 'localhost')
.on('lookup', common.mustCall(function(err, ip, type, host) {
assert.equal(err, null);
assert.equal(ip, '127.0.0.1');
assert.equal(type, '4');
assert.equal(host, 'localhost');
}));
}));